From 6931fd005267e0b52efcba5650bc3ab39dd2522b Mon Sep 17 00:00:00 2001 From: Jamie Caprani Date: Wed, 26 Jun 2024 11:05:19 +0200 Subject: [PATCH] chore(wallet/shell): minor fixes from design review (#20494) * chore(wallet): make recent tab fullscreen for empty view * chore(wallet): hide advanced button on send page * chore(wallet): hide estimated fees when no routes found * chore(wallet): update emoji icon to edit * chore(wallet): update key pair placeholder to use keypair example * chore(shell): feature flag saved address option in scanner --- .../common/floating_button_page/view.cljs | 6 +++-- .../sheets/scanned_wallet_address.cljs | 10 ++++---- .../add_account/create_account/view.cljs | 2 +- .../create_or_edit_account/view.cljs | 2 +- .../wallet/send/input_amount/view.cljs | 24 ++++++++++--------- .../wallet/send/select_address/tabs/view.cljs | 12 ++++++---- .../wallet/send/select_address/view.cljs | 9 +++---- src/status_im/feature_flags.cljs | 2 ++ translations/en.json | 2 +- 9 files changed, 38 insertions(+), 31 deletions(-) diff --git a/src/status_im/common/floating_button_page/view.cljs b/src/status_im/common/floating_button_page/view.cljs index 31b8f59bcd..f67b5f98a2 100644 --- a/src/status_im/common/floating_button_page/view.cljs +++ b/src/status_im/common/floating_button_page/view.cljs @@ -58,7 +58,7 @@ (defn view [{:keys [header footer customization-color footer-container-padding header-container-style - gradient-cover? keyboard-should-persist-taps] + content-container-style gradient-cover? keyboard-should-persist-taps] :or {footer-container-padding (safe-area/get-top)}} & children] (reagent/with-let [scroll-view-ref (atom nil) @@ -110,7 +110,9 @@ :always-bounce-vertical @keyboard-did-show? :shows-vertical-scroll-indicator false :keyboard-should-persist-taps keyboard-should-persist-taps} - (into [rn/view {:on-layout set-content-container-height}] + (into [rn/view + {:style content-container-style + :on-layout set-content-container-height}] children)] [rn/keyboard-avoiding-view {:style style/keyboard-avoiding-view diff --git a/src/status_im/contexts/shell/qr_reader/sheets/scanned_wallet_address.cljs b/src/status_im/contexts/shell/qr_reader/sheets/scanned_wallet_address.cljs index 731848a58a..f5d1bf8964 100644 --- a/src/status_im/contexts/shell/qr_reader/sheets/scanned_wallet_address.cljs +++ b/src/status_im/contexts/shell/qr_reader/sheets/scanned_wallet_address.cljs @@ -1,6 +1,7 @@ (ns status-im.contexts.shell.qr-reader.sheets.scanned-wallet-address (:require [quo.core :as quo] + [status-im.feature-flags :as ff] [utils.i18n :as i18n] [utils.re-frame :as rf])) @@ -20,7 +21,8 @@ :recipient address :stack-id :wallet-select-address :start-flow? true}]))} - {:icon :i/save - :accessibility-label :save-address - :label (i18n/label :t/save-address) - :on-press #(js/alert "feature not implemented")}]]]]) + (when (ff/enabled? :ff/wallet.saved-addresses) + {:icon :i/save + :accessibility-label :save-address + :label (i18n/label :t/save-address) + :on-press #(js/alert "feature not implemented")})]]]]) diff --git a/src/status_im/contexts/wallet/add_account/create_account/view.cljs b/src/status_im/contexts/wallet/add_account/create_account/view.cljs index e5d5c9dbae..9693f192f9 100644 --- a/src/status_im/contexts/wallet/add_account/create_account/view.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/view.cljs @@ -70,7 +70,7 @@ :icon-only? true :on-press #(rf/dispatch [:emoji-picker/open {:on-select on-select-emoji}]) :container-style style/reaction-button-container} - :i/reaction]]) + :i/edit]]) (defn- input [_] diff --git a/src/status_im/contexts/wallet/common/screen_base/create_or_edit_account/view.cljs b/src/status_im/contexts/wallet/common/screen_base/create_or_edit_account/view.cljs index 7571412f0b..d617661dce 100644 --- a/src/status_im/contexts/wallet/common/screen_base/create_or_edit_account/view.cljs +++ b/src/status_im/contexts/wallet/common/screen_base/create_or_edit_account/view.cljs @@ -49,7 +49,7 @@ :icon-only? true :on-press #(rf/dispatch [:emoji-picker/open {:on-select on-change-emoji}]) :container-style style/reaction-button-container} - :i/reaction]] + :i/edit]] [rn/view [quo/title-input diff --git a/src/status_im/contexts/wallet/send/input_amount/view.cljs b/src/status_im/contexts/wallet/send/input_amount/view.cljs index 73b10427a4..d2af04b98e 100644 --- a/src/status_im/contexts/wallet/send/input_amount/view.cljs +++ b/src/status_im/contexts/wallet/send/input_amount/view.cljs @@ -15,6 +15,7 @@ [status-im.contexts.wallet.send.routes.view :as routes] [status-im.contexts.wallet.sheets.buy-token.view :as buy-token] [status-im.contexts.wallet.sheets.unpreferred-networks-alert.view :as unpreferred-networks-alert] + [status-im.feature-flags :as ff] [utils.debounce :as debounce] [utils.i18n :as i18n] [utils.money :as money] @@ -24,16 +25,17 @@ (defn- estimated-fees [{:keys [loading-routes? fees amount]}] [rn/view {:style style/estimated-fees-container} - [rn/view {:style style/estimated-fees-content-container} - [quo/button - {:icon-only? true - :type :outline - :size 32 - :inner-style {:opacity 1} - :accessibility-label :advanced-button - :disabled? loading-routes? - :on-press #(js/alert "Not implemented yet")} - :i/advanced]] + (when (ff/enabled? ::ff/wallet.advanced-sending) + [rn/view {:style style/estimated-fees-content-container} + [quo/button + {:icon-only? true + :type :outline + :size 32 + :inner-style {:opacity 1} + :accessibility-label :advanced-button + :disabled? loading-routes? + :on-press #(js/alert "Not implemented yet")} + :i/advanced]]) [quo/data-item {:container-style style/fees-data-item :status (if loading-routes? :loading :default) @@ -376,7 +378,7 @@ sender-network-values token-not-supported-in-receiver-networks?) [token-not-available token-symbol receiver-networks token-networks]) - (when (or loading-routes? route) + (when (and (not no-routes-found?) (or loading-routes? route)) [estimated-fees {:loading-routes? loading-routes? :fees fee-formatted diff --git a/src/status_im/contexts/wallet/send/select_address/tabs/view.cljs b/src/status_im/contexts/wallet/send/select_address/tabs/view.cljs index 5137e7ac77..43b042e167 100644 --- a/src/status_im/contexts/wallet/send/select_address/tabs/view.cljs +++ b/src/status_im/contexts/wallet/send/select_address/tabs/view.cljs @@ -82,11 +82,12 @@ empty-state-component (rn/use-memo (fn [] [quo/empty-state - {:title (i18n/label :t/no-saved-addresses) - :description (i18n/label - :t/you-like-to-type-43-characters) - :image (resources/get-themed-image :sweating-man - theme)}]) + {:title (i18n/label :t/no-saved-addresses) + :description (i18n/label + :t/you-like-to-type-43-characters) + :container-style style/empty-container-style + :image (resources/get-themed-image :sweating-man + theme)}]) [theme])] [rn/section-list {:key-fn :title @@ -94,6 +95,7 @@ :render-section-header-fn section-header :sections group-saved-addresses :render-fn saved-address + :content-container-style {:flex 1} :empty-component empty-state-component}])) (defn view diff --git a/src/status_im/contexts/wallet/send/select_address/view.cljs b/src/status_im/contexts/wallet/send/select_address/view.cljs index e887504dbb..c1dc144f09 100644 --- a/src/status_im/contexts/wallet/send/select_address/view.cljs +++ b/src/status_im/contexts/wallet/send/select_address/view.cljs @@ -136,7 +136,7 @@ :keyboard-should-persist-taps :handled :render-fn suggestion-component}]])) -(defn- f-view +(defn view [] (let [on-close (fn [] (rf/dispatch [:wallet/clean-scanned-address]) @@ -155,7 +155,8 @@ local-suggestion-address (rf/sub [:wallet/local-suggestions->full-address]) color (rf/sub [:wallet/current-viewing-account-color])] [floating-button-page/view - {:footer-container-padding 0 + {:content-container-style {:flex 1} + :footer-container-padding 0 :keyboard-should-persist-taps true :header [account-switcher/view {:on-press on-close @@ -205,7 +206,3 @@ :scrollable? true :on-change on-change-tab}] [tabs/view {:selected-tab selected-tab}]])])))) - -(defn view - [] - [:f> f-view]) diff --git a/src/status_im/feature_flags.cljs b/src/status_im/feature_flags.cljs index 4cd2346987..48670c02bb 100644 --- a/src/status_im/feature_flags.cljs +++ b/src/status_im/feature_flags.cljs @@ -16,6 +16,7 @@ ::settings.saved-addresses (enabled-in-env? :FLAG_WALLET_SETTINGS_SAVED_ADDRESSES_ENABLED) ::shell.jump-to (enabled-in-env? :ENABLE_JUMP_TO) + ::wallet.advanced-sending (enabled-in-env? :FLAG_ADVANCED_SENDING) ::wallet.assets-modal-hide (enabled-in-env? :FLAG_ASSETS_MODAL_HIDE) ::wallet.assets-modal-manage-tokens (enabled-in-env? :FLAG_ASSETS_MODAL_MANAGE_TOKENS) ::wallet.bridge-token (enabled-in-env? :FLAG_BRIDGE_TOKEN_ENABLED) @@ -24,6 +25,7 @@ ::wallet.graph (enabled-in-env? :FLAG_GRAPH_ENABLED) ::wallet.import-private-key (enabled-in-env? :FLAG_IMPORT_PRIVATE_KEY_ENABLED) ::wallet.long-press-watch-only-asset (enabled-in-env? :FLAG_LONG_PRESS_WATCH_ONLY_ASSET_ENABLED) + ::wallet.saved-addresses (enabled-in-env? :WALLET_SAVED_ADDRESSES) ::wallet.swap (enabled-in-env? :FLAG_SWAP_ENABLED) ::wallet.wallet-connect (enabled-in-env? :FLAG_WALLET_CONNECT_ENABLED)}) diff --git a/translations/en.json b/translations/en.json index 27b727e98b..f6bb549e2d 100644 --- a/translations/en.json +++ b/translations/en.json @@ -2612,7 +2612,7 @@ "generating-keypair": "Generating key pair...", "keypair-name": "Key pair name", "keypair-name-description": "Name key pair for your own personal reference", - "keypair-name-input-placeholder": "Collectibles account, Old vault....", + "keypair-name-input-placeholder": "Collectibles key pair, Old vault....", "key-pair-name-updated": "Key pair name updated", "key-pair-removed": "Key pair and derived accounts has been removed", "goerli-testnet-toggle-confirmation": "Are you sure you want to toggle Goerli? This will log you out and you will have to login again.",