From 344c9ba9b7acf68783b855bb61d8299ab397421e Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Tue, 12 Sep 2023 21:49:10 +0400 Subject: [PATCH 1/2] Quo2: Settings item blur (#17258) * quo2: settings item blur --- .../contexts/quo_preview/preview.cljs | 64 +++++++++++-------- .../quo_preview/settings/settings_item.cljs | 7 +- 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/src/status_im2/contexts/quo_preview/preview.cljs b/src/status_im2/contexts/quo_preview/preview.cljs index 22acc4eb5b01..96751331df53 100644 --- a/src/status_im2/contexts/quo_preview/preview.cljs +++ b/src/status_im2/contexts/quo_preview/preview.cljs @@ -231,35 +231,43 @@ (defn preview-container - [{:keys [state descriptor blur? + [{:keys [state descriptor blur? blur-dark-only? component-container-style blur-container-style blur-view-props blur-height show-blur-background?] :or {blur-height 200}} & children] - [rn/view - {:style {:top (safe-area/get-top) - :flex 1}} - [common/navigation-bar] - [rn/scroll-view - {:style (style/panel-basic) - :shows-vertical-scroll-indicator false} - [rn/pressable {:on-press rn/dismiss-keyboard!} - (when descriptor - [rn/view {:style style/customizer-container} - [customizer state descriptor]]) - (if blur? - [rn/view {:style (merge style/component-container component-container-style)} - (into [blur-view - {:show-blur-background? show-blur-background? - :height blur-height - :style (merge {:width "100%" - :flex-grow 1} - (when-not show-blur-background? - {:padding-horizontal 0 - :top 0}) - blur-container-style) - :blur-view-props (merge {:blur-type (quo.theme/get-theme)} - blur-view-props)}] - children)] - (into [rn/view {:style (merge style/component-container component-container-style)}] - children))]]]) + [:f> + (fn [] + (rn/use-effect (fn [] + (when blur-dark-only? + (if blur? + (quo.theme/set-theme :dark) + (quo.theme/set-theme :light)))) + [blur? blur-dark-only?]) + [rn/view + {:style {:top (safe-area/get-top) + :flex 1}} + [common/navigation-bar] + [rn/scroll-view + {:style (style/panel-basic) + :shows-vertical-scroll-indicator false} + [rn/pressable {:on-press rn/dismiss-keyboard!} + (when descriptor + [rn/view {:style style/customizer-container} + [customizer state descriptor]]) + (if blur? + [rn/view {:style (merge style/component-container component-container-style)} + (into [blur-view + {:show-blur-background? show-blur-background? + :height blur-height + :style (merge {:width "100%" + :flex-grow 1} + (when-not show-blur-background? + {:padding-horizontal 0 + :top 0}) + blur-container-style) + :blur-view-props (merge {:blur-type (quo.theme/get-theme)} + blur-view-props)}] + children)] + (into [rn/view {:style (merge style/component-container component-container-style)}] + children))]]])]) diff --git a/src/status_im2/contexts/quo_preview/settings/settings_item.cljs b/src/status_im2/contexts/quo_preview/settings/settings_item.cljs index b5bbab369f98..ce65bdb1e0db 100644 --- a/src/status_im2/contexts/quo_preview/settings/settings_item.cljs +++ b/src/status_im2/contexts/quo_preview/settings/settings_item.cljs @@ -56,7 +56,9 @@ {:key :positive :value :positive} {:key :context - :value :context}]}]) + :value :context}]} + {:key :blur? + :type :boolean}]) (def communities-list [{:source (resources/get-mock-image :coinbase)} @@ -111,6 +113,7 @@ {:state state :descriptor descriptor :blur? (:blur? @state) - :show-blur-background? true} + :show-blur-background? true + :blur-dark-only? true} [rn/view {:style {:flex 1}} [quo/settings-item (get-props @state)]]]))) From 36891aae44042e150a1666c3fa8c56ea892840aa Mon Sep 17 00:00:00 2001 From: Mohsen Date: Tue, 12 Sep 2023 15:58:24 +0300 Subject: [PATCH 2/2] [#17218] fix: android channel name ellipsize completely --- .../contexts/chat/messages/content/text/view.cljs | 5 +++-- .../contexts/chat/messages/list/style.cljs | 4 ---- .../contexts/chat/messages/list/view.cljs | 15 +++++++-------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/status_im2/contexts/chat/messages/content/text/view.cljs b/src/status_im2/contexts/chat/messages/content/text/view.cljs index 571f07be5053..b6a6692b7538 100644 --- a/src/status_im2/contexts/chat/messages/content/text/view.cljs +++ b/src/status_im2/contexts/chat/messages/content/text/view.cljs @@ -2,6 +2,7 @@ (:require [quo2.core :as quo] [quo2.foundations.colors :as colors] + [quo.platform :as platform] [react-native.core :as rn] [status-im2.contexts.chat.messages.content.link-preview.view :as link-preview] [status-im2.contexts.chat.messages.content.text.style :as style] @@ -104,8 +105,8 @@ (render-inline acc e chat-id style-override mention-first)) [quo/text {:style {:size :paragraph-1 - :margin-bottom (if mention-first (if quo.platform/ios? 4 0) 2) - :margin-top (if mention-first (if quo.platform/ios? -4 0) 2) + :margin-bottom (if mention-first (if platform/ios? 4 0) 2) + :margin-top (if mention-first (if platform/ios? -4 0) 2) :color (when (seq style-override) colors/white)}}] children)]) diff --git a/src/status_im2/contexts/chat/messages/list/style.cljs b/src/status_im2/contexts/chat/messages/list/style.cljs index 85ada5ab1b1c..60e196f52062 100644 --- a/src/status_im2/contexts/chat/messages/list/style.cljs +++ b/src/status_im2/contexts/chat/messages/list/style.cljs @@ -56,9 +56,5 @@ :margin-bottom side-margin-animation} {:align-items :flex-start})) -(def name-container - {:flex-direction :row - :align-items :center}) - (def bio {:margin-top 8}) diff --git a/src/status_im2/contexts/chat/messages/list/view.cljs b/src/status_im2/contexts/chat/messages/list/view.cljs index ba53fe8994cc..4860deb066c6 100644 --- a/src/status_im2/contexts/chat/messages/list/view.cljs +++ b/src/status_im2/contexts/chat/messages/list/view.cljs @@ -223,14 +223,13 @@ :display-name display-name :online? online? :profile-picture photo-path}])] - [rn/view {:style style/name-container} - [quo/text - {:weight :semi-bold - :size :heading-1 - :style {:margin-top (if group-chat 54 12)} - :number-of-lines 1} - display-name - [contact-icon contact]]] + [quo/text + {:weight :semi-bold + :size :heading-1 + :style {:margin-top (if group-chat 54 12)} + :number-of-lines 1} + display-name + [contact-icon contact]] (when bio [quo/text {:style style/bio} bio])