Skip to content

Commit 7cb9f0f

Browse files
committed
fix contrast between Chats and Communities with new messages
1 parent d7242f1 commit 7cb9f0f

File tree

2 files changed

+24
-56
lines changed

2 files changed

+24
-56
lines changed

src/quo/components/community/community_list_view.cljs

+10-49
Original file line numberDiff line numberDiff line change
@@ -38,55 +38,20 @@
3838
unread-messages?
3939
[unread-grey-dot :unviewed-messages-public])])
4040

41-
(defn communities-list-view-item
42-
[{:keys [customization-color] :as props}
43-
{:keys [name locked? status muted unread-messages? unread-mentions-count community-icon tokens]}]
44-
(let [theme (quo.theme/use-theme)]
45-
[rn/view
46-
{:style (merge (style/community-card 16 theme)
47-
{:margin-bottom 12})}
48-
[rn/touchable-highlight
49-
(merge {:style {:height 56
50-
:border-radius 16}}
51-
props)
52-
[rn/view {:style style/detail-container}
53-
[rn/view (style/list-info-container)
54-
[community-icon/community-icon
55-
{:images community-icon} 32]
56-
[rn/view
57-
{:flex 1
58-
:margin-horizontal 12}
59-
[text/text
60-
{:weight :semi-bold
61-
:size :paragraph-1
62-
:accessibility-label :community-name-text
63-
:number-of-lines 1
64-
:ellipsize-mode :tail
65-
:style {:color (when muted
66-
(colors/theme-colors
67-
colors/neutral-40
68-
colors/neutral-60
69-
theme))}}
70-
name]
71-
[community-view/community-stats-column
72-
{:type :list-view}]]
73-
(if (= status :gated)
74-
[community-view/permission-tag-container
75-
{:locked? locked?
76-
:tokens tokens}]
77-
[notification-view
78-
{:customization-color customization-color
79-
:theme theme
80-
:muted? muted
81-
:unread-mentions-count unread-mentions-count
82-
:unread-messages? unread-messages?}])]]]]))
41+
(defn- title-color
42+
[unread-messages? muted theme]
43+
(cond
44+
muted (colors/theme-colors colors/neutral-40 colors/neutral-60 theme)
45+
unread-messages? (colors/theme-colors colors/neutral-100 colors/white theme)
46+
:else (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)))
8347

8448
(defn communities-membership-list-item
8549
[{:keys [customization-color] :as props}
8650
bottom-sheet?
8751
{:keys [name muted unviewed-messages-count unviewed-mentions-count status
8852
images tokens locked? style]}]
89-
(let [theme (quo.theme/use-theme)]
53+
(let [theme (quo.theme/use-theme)
54+
unread-messages? (pos? unviewed-messages-count)]
9055
[rn/touchable-highlight
9156
(merge {:underlay-color (colors/theme-colors
9257
colors/neutral-5
@@ -108,11 +73,7 @@
10873
:ellipsize-mode :tail
10974
:weight :semi-bold
11075
:size :paragraph-1
111-
:style (when muted
112-
{:color (colors/theme-colors
113-
colors/neutral-40
114-
colors/neutral-60
115-
theme)})}
76+
:style {:color (title-color unread-messages? muted theme)}}
11677
name]]
11778

11879
[rn/view
@@ -128,4 +89,4 @@
12889
:customization-color customization-color
12990
:muted? muted
13091
:unread-mentions-count unviewed-mentions-count
131-
:unread-messages? (pos? unviewed-messages-count)}])]]]))
92+
: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)