From 141fbba9a461f84496a2b54c620fdbcc771baae0 Mon Sep 17 00:00:00 2001 From: flexsurfer Date: Mon, 16 Dec 2024 17:49:59 +0100 Subject: [PATCH] [#21828] Close the flows for adding accounts in keycard accounts (#21829) --- src/status_im/contexts/wallet/home/view.cljs | 31 ++++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/status_im/contexts/wallet/home/view.cljs b/src/status_im/contexts/wallet/home/view.cljs index 77b453e9bf..7c59149acf 100644 --- a/src/status_im/contexts/wallet/home/view.cljs +++ b/src/status_im/contexts/wallet/home/view.cljs @@ -15,19 +15,24 @@ (defn new-account [] - [quo/action-drawer - [[{:icon :i/add - :accessibility-label :start-a-new-chat - :label (i18n/label :t/add-account) - :sub-label (i18n/label :t/add-account-description) - :on-press #(rf/dispatch [:navigate-to :screen/wallet.create-account])} - (when (ff/enabled? ::ff/wallet.add-watched-address) - {:icon :i/reveal - :accessibility-label :add-a-contact - :label (i18n/label :t/add-address-to-watch) - :sub-label (i18n/label :t/add-address-to-watch-description) - :on-press #(rf/dispatch [:navigate-to :screen/wallet.add-address-to-watch]) - :add-divider? true})]]]) + (let [keycard? (rf/sub [:keycard/keycard-profile?])] + [quo/action-drawer + [[{:icon :i/add + :accessibility-label :start-a-new-chat + :label (i18n/label :t/add-account) + :sub-label (i18n/label :t/add-account-description) + :on-press (fn [] + (if keycard? + (rf/dispatch [:keycard/feature-unavailable-show + {:feature-name :wallet.new-account}]) + (rf/dispatch [:navigate-to :screen/wallet.create-account])))} + (when (ff/enabled? ::ff/wallet.add-watched-address) + {:icon :i/reveal + :accessibility-label :add-a-contact + :label (i18n/label :t/add-address-to-watch) + :sub-label (i18n/label :t/add-address-to-watch-description) + :on-press #(rf/dispatch [:navigate-to :screen/wallet.add-address-to-watch]) + :add-divider? true})]]])) (defn- new-account-card-data []