Skip to content

Commit cdb2370

Browse files
authored
fix contrast between Chats and Communities with new messages (#21242)
1 parent 5d6b46a commit cdb2370

File tree

2 files changed

+25
-14
lines changed

2 files changed

+25
-14
lines changed

src/quo/components/community/community_list_view.cljs

+11-7
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,20 @@
8181
:unread-mentions-count unread-mentions-count
8282
:unread-messages? unread-messages?}])]]]]))
8383

84+
(defn- title-color
85+
[unread-messages? muted theme]
86+
(cond
87+
muted (colors/theme-colors colors/neutral-40 colors/neutral-60 theme)
88+
unread-messages? (colors/theme-colors colors/neutral-100 colors/white theme)
89+
:else (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)))
90+
8491
(defn communities-membership-list-item
8592
[{:keys [customization-color] :as props}
8693
bottom-sheet?
8794
{:keys [name muted unviewed-messages-count unviewed-mentions-count status
8895
images tokens locked? style]}]
89-
(let [theme (quo.theme/use-theme)]
96+
(let [theme (quo.theme/use-theme)
97+
unread-messages? (pos? unviewed-messages-count)]
9098
[rn/touchable-highlight
9199
(merge {:underlay-color (colors/theme-colors
92100
colors/neutral-5
@@ -108,11 +116,7 @@
108116
:ellipsize-mode :tail
109117
:weight :semi-bold
110118
:size :paragraph-1
111-
:style (when muted
112-
{:color (colors/theme-colors
113-
colors/neutral-40
114-
colors/neutral-60
115-
theme)})}
119+
:style {:color (title-color unread-messages? muted theme)}}
116120
name]]
117121

118122
[rn/view
@@ -128,4 +132,4 @@
128132
:customization-color customization-color
129133
:muted? muted
130134
:unread-mentions-count unviewed-mentions-count
131-
:unread-messages? (pos? unviewed-messages-count)}])]]]))
135+
:unread-messages? unread-messages?}])]]]))

src/status_im/contexts/chat/home/chat_list_item/view.cljs

+14-7
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,16 @@
146146
"")]
147147
(subs preview-text 0 (min (count preview-text) max-subheader-length))))
148148

149+
(defn- last-message-color
150+
[unread-messages? muted theme]
151+
(cond
152+
muted (colors/theme-colors colors/neutral-50 colors/neutral-60 theme)
153+
unread-messages? (colors/theme-colors colors/neutral-100 colors/white theme)
154+
:else (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)))
155+
149156
(defn last-message-preview
150157
"Render the preview of a last message to a maximum of max-subheader-length characters"
151-
[group-chat {:keys [deleted? outgoing from deleted-for-me?] :as message}]
158+
[group-chat {:keys [deleted? outgoing from deleted-for-me?] :as message} muted unread-messages?]
152159
(let [theme (quo.theme/use-theme)
153160
[primary-name _] (rf/sub [:contacts/contact-two-names-by-identity from])
154161
preview-text (if deleted-for-me?
@@ -162,9 +169,7 @@
162169
(preview-text-from-content group-chat primary-name message)))]
163170
[quo/text
164171
{:size :paragraph-2
165-
:style {:color (colors/theme-colors colors/neutral-50
166-
colors/neutral-40
167-
theme)
172+
:style {:color (last-message-color unread-messages? muted theme)
168173
:flex 1}
169174
:number-of-lines 1
170175
:ellipsize-mode :tail
@@ -231,14 +236,16 @@
231236
unviewed-messages-count]])))
232237

233238
(defn chat-item
234-
[{:keys [chat-id group-chat color name last-message timestamp muted image]
239+
[{:keys [chat-id group-chat color name last-message timestamp muted image
240+
unviewed-messages-count]
235241
:as item}]
236242
(let [[primary-name secondary-name]
237243
(if group-chat
238244
[name ""]
239245
(rf/sub [:contacts/contact-two-names-by-identity chat-id]))
240246
{:keys [ens-verified added?] :as contact} (when-not group-chat
241-
(rf/sub [:contacts/contact-by-address chat-id]))]
247+
(rf/sub [:contacts/contact-by-address chat-id]))
248+
unread-messages? (pos? unviewed-messages-count)]
242249
[rn/view {:style {:flex-direction :row}}
243250
[avatar-view
244251
{:contact contact
@@ -258,7 +265,7 @@
258265
:muted? muted
259266
:time-str (datetime/to-short-str timestamp)
260267
:style {:flex-shrink 1}}]
261-
[last-message-preview group-chat last-message muted]]]
268+
[last-message-preview group-chat last-message muted unread-messages?]]]
262269
[notification item]]))
263270

264271
(defn chat-user

0 commit comments

Comments
 (0)