Skip to content

Commit 352797b

Browse files
committed
feat: chat list customization color
for one-to-one chat, use contact color for group chat, use chat color
1 parent a99cfb8 commit 352797b

File tree

1 file changed

+18
-13
lines changed
  • src/status_im/contexts/chat/messenger/messages/list

1 file changed

+18
-13
lines changed

src/status_im/contexts/chat/messenger/messages/list/view.cljs

+18-13
Original file line numberDiff line numberDiff line change
@@ -328,19 +328,24 @@
328328
(defn messages-list-content
329329
[{:keys [insets distance-from-list-top content-height layout-height distance-atom
330330
chat-screen-layout-calculations-complete? chat-list-scroll-y]}]
331-
(let [theme (quo.theme/use-theme-value)
332-
chat (rf/sub [:chats/current-chat-chat-view])
333-
community-channel? (= constants/community-chat-type (:chat-type chat))
334-
customization-color (if community-channel?
335-
(or (:color chat)
336-
(rf/sub [:communities/community-color (:community-id chat)]))
337-
:turquoise)
338-
{:keys [keyboard-shown]} (hooks/use-keyboard)
339-
{window-height :height} (rn/get-window)
340-
context (rf/sub [:chats/current-chat-message-list-view-context])
341-
messages (rf/sub [:chats/raw-chat-messages-stream
342-
(:chat-id chat)])
343-
recording? (rf/sub [:chats/recording?])]
331+
(let [theme (quo.theme/use-theme-value)
332+
{:keys [chat-type chat-id] :as chat} (rf/sub [:chats/current-chat-chat-view])
333+
one-to-one-chat? (= chat-type constants/one-to-one-chat-type)
334+
community-channel? (= constants/community-chat-type chat-type)
335+
{contact-customization-color
336+
:customization-color} (when one-to-one-chat?
337+
(rf/sub [:contacts/contact-by-identity chat-id]))
338+
customization-color (cond community-channel?
339+
(or (:color chat)
340+
(rf/sub [:communities/community-color
341+
(:community-id chat)]))
342+
one-to-one-chat? contact-customization-color
343+
:else (or (:color chat) :turquoise))
344+
{:keys [keyboard-shown]} (hooks/use-keyboard)
345+
{window-height :height} (rn/get-window)
346+
context (rf/sub [:chats/current-chat-message-list-view-context])
347+
messages (rf/sub [:chats/raw-chat-messages-stream chat-id])
348+
recording? (rf/sub [:chats/recording?])]
344349
[rn/view {:style {:flex 3}} ;; Pushes composer to bottom
345350
[rn/view {:style {:flex-shrink 1}} ;; Keeps flat list on top
346351
[reanimated/flat-list

0 commit comments

Comments
 (0)