diff --git a/src/status_im/common/home/top_nav/view.cljs b/src/status_im/common/home/top_nav/view.cljs index 3e6873dab5..3c3944cb9f 100644 --- a/src/status_im/common/home/top_nav/view.cljs +++ b/src/status_im/common/home/top_nav/view.cljs @@ -30,12 +30,15 @@ ; should be :notification TODO ; https://github.com/status-im/status-mobile/issues/17102 :unread-indicator/new :mention - nil)] + nil) + view-id (rf/sub [:view-id]) + initial-share-tab (if (= :wallet-stack view-id) :wallet :profile)] [quo/top-nav {:avatar-on-press #(rf/dispatch [:open-modal :settings]) :scan-on-press #(rf/dispatch [:open-modal :shell-qr-reader]) :activity-center-on-press #(rf/dispatch [:activity-center/open]) - :qr-code-on-press #(rf/dispatch [:open-modal :screen/share-shell]) + :qr-code-on-press #(rf/dispatch [:open-modal :screen/share-shell + {:initial-tab initial-share-tab}]) :container-style (merge style/top-nav-container container-style) :blur? blur? :jump-to? jump-to? diff --git a/src/status_im/contexts/profile/settings/view.cljs b/src/status_im/contexts/profile/settings/view.cljs index 387e9030f7..59f173ac9d 100644 --- a/src/status_im/contexts/profile/settings/view.cljs +++ b/src/status_im/contexts/profile/settings/view.cljs @@ -70,7 +70,8 @@ :icon-name :i/close :on-press #(rf/dispatch [:navigate-back]) :right-side [{:icon-name :i/qr-code - :on-press #(debounce/throttle-and-dispatch [:open-modal :screen/share-shell] + :on-press #(debounce/throttle-and-dispatch [:open-modal :screen/share-shell + {:initial-tab :profile}] 1000)} {:icon-name :i/share :on-press #(rf/dispatch [:open-share diff --git a/src/status_im/contexts/shell/share/view.cljs b/src/status_im/contexts/shell/share/view.cljs index 8c7f23232c..d0abbb4b94 100644 --- a/src/status_im/contexts/shell/share/view.cljs +++ b/src/status_im/contexts/shell/share/view.cljs @@ -3,14 +3,13 @@ [quo.core :as quo] [react-native.core :as rn] [react-native.safe-area :as safe-area] - [reagent.core :as reagent] [status-im.contexts.shell.share.profile.view :as profile-view] [status-im.contexts.shell.share.style :as style] [status-im.contexts.shell.share.wallet.view :as wallet-view] [utils.i18n :as i18n] [utils.re-frame :as rf])) -(defn header +(defn- header [] [:<> [rn/view {:style style/header-row} @@ -39,29 +38,29 @@ :style style/header-heading} (i18n/label :t/share)]]) -(defn tab-content - [] - (let [selected-tab (reagent/atom :profile)] - (fn [] - [rn/view {:style {:padding-top (safe-area/get-top)}} - [header] - [rn/view {:style style/tabs-container} - [quo/segmented-control - {:size 28 - :blur? true - :on-change #(reset! selected-tab %) - :default-active :profile - :data [{:id :profile - :label (i18n/label :t/profile)} - {:id :wallet - :label (i18n/label :t/wallet)}]}]] - (if (= @selected-tab :profile) - [profile-view/profile-tab] - [wallet-view/wallet-tab])]))) +(defn- tab-content + [initial-tab] + (let [[selected-tab set-selected-tab] (rn/use-state initial-tab)] + [rn/view {:style {:padding-top (safe-area/get-top)}} + [header] + [rn/view {:style style/tabs-container} + [quo/segmented-control + {:size 28 + :blur? true + :on-change set-selected-tab + :default-active selected-tab + :data [{:id :profile + :label (i18n/label :t/profile)} + {:id :wallet + :label (i18n/label :t/wallet)}]}]] + (if (= selected-tab :wallet) + [wallet-view/wallet-tab] + [profile-view/profile-tab])])) (defn view [] - [quo/overlay {:type :shell} - [rn/view - {:key :share} - [tab-content]]]) + (let [{:keys [initial-tab] :or {initial-tab :profile}} (rf/sub [:get-screen-params])] + [quo/overlay {:type :shell} + [rn/view + {:key :share} + [tab-content initial-tab]]])) diff --git a/src/status_im/contexts/wallet/common/activity_tab/view.cljs b/src/status_im/contexts/wallet/common/activity_tab/view.cljs index bc43a3808a..8a29a37e64 100644 --- a/src/status_im/contexts/wallet/common/activity_tab/view.cljs +++ b/src/status_im/contexts/wallet/common/activity_tab/view.cljs @@ -24,14 +24,14 @@ (let [chain-id (or (:chain-id token-in) (:chain-id token-out)) amount-in-units (native-module/hex-to-number (utils.hex/normalize-hex amount-in)) - amount-in-value (money/with-precision - (money/wei->ether amount-in-units) - precision) + amount-in-value (str (money/with-precision + (money/wei->ether amount-in-units) + precision)) amount-out-units (native-module/hex-to-number (utils.hex/normalize-hex amount-out)) - amount-out-value (money/with-precision - (money/wei->ether amount-out-units) - precision) + amount-out-value (str (money/with-precision + (money/wei->ether amount-out-units) + precision)) relative-date (datetime/timestamp->relative (* timestamp 1000)) receiving-activity? (= activity-type constants/wallet-activity-type-receive)] [quo/wallet-activity diff --git a/src/status_im/contexts/wallet/common/token_value/view.cljs b/src/status_im/contexts/wallet/common/token_value/view.cljs index ad8a4f1a34..88be7d1a07 100644 --- a/src/status_im/contexts/wallet/common/token_value/view.cljs +++ b/src/status_im/contexts/wallet/common/token_value/view.cljs @@ -26,11 +26,13 @@ (rf/dispatch [:wallet/set-token-to-send send-params]))}) (defn- action-receive - [] + [selected-account?] {:icon :i/receive :accessibility-label :receive :label (i18n/label :t/receive) - :on-press #(rf/dispatch [:open-modal :screen/wallet.share-address {:status :receive}])}) + :on-press (if selected-account? + #(rf/dispatch [:open-modal :screen/wallet.share-address {:status :receive}]) + #(rf/dispatch [:open-modal :screen/share-shell {:initial-tab :wallet}]))}) (defn- action-bridge [token-data] @@ -80,7 +82,7 @@ (action-hide))] (not watch-only?) (concat [(action-buy) (action-send send-params) - (action-receive) + (action-receive selected-account?) (when (ff/enabled? ::ff/wallet.swap) (action-swap)) (action-bridge token-data)]))]]))