From d9d14a2138abb81830995dd5d88c7320b4dcdc23 Mon Sep 17 00:00:00 2001 From: Mohsen Date: Wed, 5 Jun 2024 14:12:15 +0300 Subject: [PATCH 1/2] [#19765] feat: save an address by scanning it's QR code --- .../wallet/saved_addresses/add_address_to_save/view.cljs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/status_im/contexts/settings/wallet/saved_addresses/add_address_to_save/view.cljs b/src/status_im/contexts/settings/wallet/saved_addresses/add_address_to_save/view.cljs index d4613207d83..13f14eb013e 100644 --- a/src/status_im/contexts/settings/wallet/saved_addresses/add_address_to_save/view.cljs +++ b/src/status_im/contexts/settings/wallet/saved_addresses/add_address_to_save/view.cljs @@ -6,7 +6,6 @@ [react-native.core :as rn] [react-native.safe-area :as safe-area] [status-im.common.floating-button-page.view :as floating-button-page] - [status-im.common.not-implemented :as not-implemented] [status-im.contexts.settings.wallet.saved-addresses.add-address-to-save.style :as style] [status-im.contexts.wallet.common.validation :as validation] [utils.i18n :as i18n] @@ -35,7 +34,10 @@ (defn- address-input [{:keys [input-value on-change-text paste-into-input clear-input]}] - (let [empty-input? (string/blank? input-value)] + (let [empty-input? (string/blank? input-value) + on-scan-result (rn/use-callback #(on-change-text %)) + on-scan-address (rn/use-callback #(rf/dispatch [:open-modal :screen/wallet.scan-address + {:on-result on-scan-result}]))] [rn/view {:style style/input-container} [quo/input {:accessibility-label :add-address-to-save @@ -55,7 +57,7 @@ :value input-value}] [quo/button {:type :outline - :on-press not-implemented/alert + :on-press on-scan-address :container-style style/scan-button :background :blur :size 40 From 7e9795b13a7c4452a4c02a1ca92d107331fe4795 Mon Sep 17 00:00:00 2001 From: Mohsen Date: Wed, 5 Jun 2024 14:43:25 +0300 Subject: [PATCH 2/2] [#19765] fix: remove redundant use-callback --- .../wallet/saved_addresses/add_address_to_save/view.cljs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/status_im/contexts/settings/wallet/saved_addresses/add_address_to_save/view.cljs b/src/status_im/contexts/settings/wallet/saved_addresses/add_address_to_save/view.cljs index 13f14eb013e..5fa228cffde 100644 --- a/src/status_im/contexts/settings/wallet/saved_addresses/add_address_to_save/view.cljs +++ b/src/status_im/contexts/settings/wallet/saved_addresses/add_address_to_save/view.cljs @@ -35,9 +35,8 @@ (defn- address-input [{:keys [input-value on-change-text paste-into-input clear-input]}] (let [empty-input? (string/blank? input-value) - on-scan-result (rn/use-callback #(on-change-text %)) on-scan-address (rn/use-callback #(rf/dispatch [:open-modal :screen/wallet.scan-address - {:on-result on-scan-result}]))] + {:on-result on-change-text}]))] [rn/view {:style style/input-container} [quo/input {:accessibility-label :add-address-to-save