From 4d7cf3e94e0799522d2b5cf6e399b265630c05fe Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Thu, 6 Jul 2023 15:27:18 +0530 Subject: [PATCH] Replace placeholders on "Jump to" page (#16501) --- src/status_im2/common/home/view.cljs | 15 ++++++++++----- src/status_im2/contexts/chat/home/view.cljs | 8 +------- .../contexts/communities/home/view.cljs | 8 +------- .../jump_to/components/jump_to_screen/view.cljs | 9 ++++----- src/status_im2/contexts/shell/jump_to/view.cljs | 5 ++--- src/status_im2/subs/shell.cljs | 2 +- 6 files changed, 19 insertions(+), 28 deletions(-) diff --git a/src/status_im2/common/home/view.cljs b/src/status_im2/common/home/view.cljs index 2ae791efc0..ac39b65871 100644 --- a/src/status_im2/common/home/view.cljs +++ b/src/status_im2/common/home/view.cljs @@ -4,6 +4,7 @@ [quo2.foundations.colors :as colors] [react-native.core :as rn] [status-im2.common.home.style :as style] + [status-im.multiaccounts.core :as multiaccounts] [status-im2.common.plus-button.view :as plus-button] [status-im2.constants :as constants] [utils.re-frame :as rf] @@ -117,11 +118,15 @@ props {:type quo/button types :style override-style - :avatar user-avatar :search? When non-nil, show search button} " - [{:keys [type style avatar search?] + [{:keys [type style search?] :or {type :default}}] - [rn/view {:style (merge style/top-nav-container style)} - [left-section {:avatar avatar}] - [right-section {:button-type type :search? search?}]]) + (let [account (rf/sub [:profile/multiaccount]) + customization-color (rf/sub [:profile/customization-color]) + avatar {:customization-color customization-color + :full-name (multiaccounts/displayed-name account) + :profile-picture (multiaccounts/displayed-photo account)}] + [rn/view {:style (merge style/top-nav-container style)} + [left-section {:avatar avatar}] + [right-section {:button-type type :search? search?}]])) diff --git a/src/status_im2/contexts/chat/home/view.cljs b/src/status_im2/contexts/chat/home/view.cljs index 6fca59e2d6..c39d85aaa4 100644 --- a/src/status_im2/contexts/chat/home/view.cljs +++ b/src/status_im2/contexts/chat/home/view.cljs @@ -7,7 +7,6 @@ [react-native.core :as rn] [react-native.platform :as platform] [react-native.safe-area :as safe-area] - [status-im.multiaccounts.core :as multiaccounts] [status-im2.common.contact-list-item.view :as contact-list-item] [status-im2.common.contact-list.view :as contact-list] [status-im2.common.home.actions.view :as actions] @@ -121,7 +120,6 @@ [] (let [pending-contact-requests (rf/sub [:activity-center/pending-contact-requests]) selected-tab (or (rf/sub [:messages-home/selected-tab]) :tab/recent) - account (rf/sub [:profile/multiaccount]) customization-color (rf/sub [:profile/customization-color]) top (safe-area/get-top)] [:<> @@ -138,11 +136,7 @@ (theme/theme-value colors/white colors/neutral-95-opa-70) (when (colors/dark?) colors/neutral-95-opa-70))}]) - [common.home/top-nav - {:type :grey - :avatar {:customization-color customization-color - :full-name (multiaccounts/displayed-name account) - :profile-picture (multiaccounts/displayed-photo account)}}] + [common.home/top-nav {:type :grey}] [common.home/title-column {:label (i18n/label :t/messages) :handler #(rf/dispatch [:show-bottom-sheet {:content home.sheet/new-chat}]) diff --git a/src/status_im2/contexts/communities/home/view.cljs b/src/status_im2/contexts/communities/home/view.cljs index e8622be12e..57ad8b58fd 100644 --- a/src/status_im2/contexts/communities/home/view.cljs +++ b/src/status_im2/contexts/communities/home/view.cljs @@ -6,7 +6,6 @@ [react-native.core :as rn] [react-native.platform :as platform] [react-native.safe-area :as safe-area] - [status-im.multiaccounts.core :as multiaccounts] [status-im2.common.home.view :as common.home] [status-im2.common.resources :as resources] [status-im2.contexts.communities.actions.community-options.view :as options] @@ -73,7 +72,6 @@ [] (let [selected-tab (or (rf/sub [:communities/selected-tab]) :joined) {:keys [joined pending opened]} (rf/sub [:communities/grouped-by-status]) - account (rf/sub [:profile/multiaccount]) customization-color (rf/sub [:profile/customization-color]) selected-items (case selected-tab :joined joined @@ -103,11 +101,7 @@ (theme/theme-value colors/white colors/neutral-95-opa-70) (when (colors/dark?) colors/neutral-95-opa-70))}]) - [common.home/top-nav - {:type :grey - :avatar {:customization-color customization-color - :full-name (multiaccounts/displayed-name account) - :profile-picture (multiaccounts/displayed-photo account)}}] + [common.home/top-nav {:type :grey}] [common.home/title-column {:label (i18n/label :t/communities) :handler #(rf/dispatch [:show-bottom-sheet {:content actions.home-plus/view}]) diff --git a/src/status_im2/contexts/shell/jump_to/components/jump_to_screen/view.cljs b/src/status_im2/contexts/shell/jump_to/components/jump_to_screen/view.cljs index da98482288..c7c9bf1eed 100644 --- a/src/status_im2/contexts/shell/jump_to/components/jump_to_screen/view.cljs +++ b/src/status_im2/contexts/shell/jump_to/components/jump_to_screen/view.cljs @@ -94,7 +94,7 @@ [blur/view (bottom-tabs/blur-overlay-params style/top-nav-blur-overlay)])])) (defn view - [customization-color] + [] (let [switcher-cards (rf/sub [:shell/sorted-switcher-cards]) width (rf/sub [:dimensions/window-width]) top (safe-area/get-top) @@ -110,7 +110,6 @@ [jump-to-list switcher-cards shell-margin] [top-nav-blur-overlay top] [common.home/top-nav - {:type :shell - :avatar {:customization-color customization-color} - :style {:margin-top top - :z-index 2}}]]])) + {:type :shell + :style {:margin-top top + :z-index 2}}]]])) diff --git a/src/status_im2/contexts/shell/jump_to/view.cljs b/src/status_im2/contexts/shell/jump_to/view.cljs index e8f1ab3212..41cf5dd102 100644 --- a/src/status_im2/contexts/shell/jump_to/view.cljs +++ b/src/status_im2/contexts/shell/jump_to/view.cljs @@ -42,15 +42,14 @@ (defn f-shell-stack [] - (let [shared-values (shared-values/calculate-and-set-shared-values) - customization-color (rf/sub [:profile/customization-color])] + (let [shared-values (shared-values/calculate-and-set-shared-values)] (rn/use-effect (fn [] (rn/hw-back-add-listener navigate-back-handler) #(rn/hw-back-remove-listener navigate-back-handler)) []) [:<> - [jump-to-screen/view customization-color] + [jump-to-screen/view] [:f> bottom-tabs/f-bottom-tabs] [:f> home-stack/f-home-stack] [floating-button shared-values] diff --git a/src/status_im2/subs/shell.cljs b/src/status_im2/subs/shell.cljs index 2bd4abb302..083bd26444 100644 --- a/src/status_im2/subs/shell.cljs +++ b/src/status_im2/subs/shell.cljs @@ -77,7 +77,7 @@ (let [images (:images contact) profile-picture (:uri (or (:thumbnail images) (:large images) (first images)))] {:title (first names) - :avatar-params {:full-name (last names) + :avatar-params {:full-name (first names) :profile-picture (when profile-picture (str profile-picture "&addRing=0"))} :customization-color (or (:customization-color contact) :primary)