|
328 | 328 | (defn messages-list-content
|
329 | 329 | [{:keys [insets distance-from-list-top content-height layout-height distance-atom
|
330 | 330 | 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?])] |
344 | 349 | [rn/view {:style {:flex 3}} ;; Pushes composer to bottom
|
345 | 350 | [rn/view {:style {:flex-shrink 1}} ;; Keeps flat list on top
|
346 | 351 | [reanimated/flat-list
|
|
0 commit comments