From 68b9ea47a8a2035488c596df0d4161ae2e3c5226 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 16 Jun 2023 15:48:52 +0200 Subject: [PATCH] Fix for two separate sections with different colors shown on the chat screen (dark mode) (#16265) * Fix for two separate sections with different colors shown on the chat screen (dark mode) * lint-fix --- src/status_im2/contexts/chat/messages/list/style.cljs | 7 ++++--- src/status_im2/contexts/chat/messages/list/view.cljs | 6 +++--- src/status_im2/contexts/chat/messages/view.cljs | 3 ++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/status_im2/contexts/chat/messages/list/style.cljs b/src/status_im2/contexts/chat/messages/list/style.cljs index f150834fe8..97161988f8 100644 --- a/src/status_im2/contexts/chat/messages/list/style.cljs +++ b/src/status_im2/contexts/chat/messages/list/style.cljs @@ -20,7 +20,7 @@ (defn header-container [show?] {:display (if show? :flex :none) - :background-color (colors/theme-colors colors/white colors/neutral-95) + :background-color (colors/theme-colors colors/white colors/neutral-100) :top (- overscroll-cover-height) :margin-bottom (- overscroll-cover-height)}) @@ -28,7 +28,8 @@ [cover-bg-color] {:flex 1 :height (+ overscroll-cover-height cover-height) - :background-color cover-bg-color}) + :background-color (colors/theme-colors (:light cover-bg-color) + (:dark cover-bg-color))}) (defn header-bottom-part [animation] @@ -38,7 +39,7 @@ {:top -16 :margin-bottom -16 :padding-bottom 24 - :background-color (colors/theme-colors colors/white colors/neutral-100)})) + :background-color (colors/theme-colors colors/white colors/neutral-95)})) (def header-avatar {:top header-avatar-top-offset diff --git a/src/status_im2/contexts/chat/messages/list/view.cljs b/src/status_im2/contexts/chat/messages/list/view.cljs index bb6b0d3f2c..4fe8923511 100644 --- a/src/status_im2/contexts/chat/messages/list/view.cljs +++ b/src/status_im2/contexts/chat/messages/list/view.cljs @@ -195,8 +195,7 @@ [rn/view {:style (style/header-container all-loaded?) :on-layout on-layout} - (when cover-bg-color - [rn/view {:style (style/header-cover cover-bg-color)}]) + [rn/view {:style (style/header-cover cover-bg-color)}] [reanimated/view {:style (style/header-bottom-part border-animation)} [rn/view {:style style/header-avatar} [rn/view {:style {:align-items :flex-start}} @@ -306,7 +305,8 @@ (on-scroll event))) :style (add-inverted-y-android {:background-color (if all-loaded? - cover-bg-color + (colors/theme-colors (:light cover-bg-color) + (:dark cover-bg-color)) (colors/theme-colors colors/white colors/neutral-95))}) diff --git a/src/status_im2/contexts/chat/messages/view.cljs b/src/status_im2/contexts/chat/messages/view.cljs index 894fba6a40..5b4bbb6ffb 100644 --- a/src/status_im2/contexts/chat/messages/view.cljs +++ b/src/status_im2/contexts/chat/messages/view.cljs @@ -23,7 +23,8 @@ able-to-send-message?] :as chat} (rf/sub [:chats/current-chat-chat-view])] [messages.list/messages-list - {:cover-bg-color (colors/custom-color :turquoise 50 20) + {:cover-bg-color {:light (colors/custom-color :turquoise 50 20) + :dark (colors/custom-color :turquoise 50 40)} :chat chat :header-comp (fn [{:keys [scroll-y shared-all-loaded?]}] [messages.navigation/navigation-view