fix: multiple address input fixes (#20005)

fix: multiple address input fixes (#20005)
This commit is contained in:
Omar Basem 2024-05-20 14:53:15 +04:00 committed by GitHub
parent 3e4cbfeb69
commit 29b02a544c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 31 additions and 24 deletions

View File

@ -133,8 +133,7 @@
:on-focus on-focus :on-focus on-focus
:on-blur on-blur :on-blur on-blur
:on-change-text on-change}] :on-change-text on-change}]
(when (or (= status :default) (when (empty? value)
(= status :active))
[rn/view [rn/view
{:style style/buttons-container {:style style/buttons-container
:accessibility-label :paste-scan-buttons-container} :accessibility-label :paste-scan-buttons-container}
@ -155,7 +154,9 @@
:inner-style (style/accessory-button blur? theme) :inner-style (style/accessory-button blur? theme)
:on-press on-scan} :on-press on-scan}
:main-icons/scan])]) :main-icons/scan])])
(when (= status :typing) (when (or (= status :typing)
(and (= status :active)
(not-empty value)))
[rn/view [rn/view
{:style style/buttons-container {:style style/buttons-container
:accessibility-label :clear-button-container} :accessibility-label :clear-button-container}
@ -168,7 +169,10 @@
{:style style/buttons-container {:style style/buttons-container
:accessibility-label :loading-button-container} :accessibility-label :loading-button-container}
[loading-icon blur? theme]]) [loading-icon blur? theme]])
(when (and (= status :loading) valid-ens-or-address?) (when (and (or (= status :loading)
(= status :default))
valid-ens-or-address?
(not-empty value))
[rn/view [rn/view
{:style style/buttons-container {:style style/buttons-container
:accessibility-label :positive-button-container} :accessibility-label :positive-button-container}

View File

@ -58,7 +58,7 @@
(defn view (defn view
[{:keys [header footer customization-color footer-container-padding header-container-style [{:keys [header footer customization-color footer-container-padding header-container-style
gradient-cover?] gradient-cover? keyboard-should-persist-taps]
:or {footer-container-padding (safe-area/get-top)}} :or {footer-container-padding (safe-area/get-top)}}
& children] & children]
(reagent/with-let [scroll-view-ref (atom nil) (reagent/with-let [scroll-view-ref (atom nil)
@ -108,7 +108,8 @@
:padding-bottom (when @keyboard-did-show? :padding-bottom (when @keyboard-did-show?
@footer-container-height)} @footer-container-height)}
:always-bounce-vertical @keyboard-did-show? :always-bounce-vertical @keyboard-did-show?
:shows-vertical-scroll-indicator false} :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 {:on-layout set-content-container-height}]
children)] children)]
[rn/keyboard-avoiding-view [rn/keyboard-avoiding-view

View File

@ -156,24 +156,26 @@
local-suggestion-address (rf/sub [:wallet/local-suggestions->full-address]) local-suggestion-address (rf/sub [:wallet/local-suggestions->full-address])
color (rf/sub [:wallet/current-viewing-account-color])] color (rf/sub [:wallet/current-viewing-account-color])]
[floating-button-page/view [floating-button-page/view
{:footer-container-padding 0 {:footer-container-padding 0
:header [account-switcher/view :keyboard-should-persist-taps true
{:on-press on-close :header [account-switcher/view
:margin-top (safe-area/get-top) {:on-press on-close
:switcher-type :select-account}] :margin-top (safe-area/get-top)
:footer (when (> (count @input-value) 0) :switcher-type :select-account}]
[quo/button :footer (when (> (count @input-value) 0)
{:accessibility-label :continue-button [quo/button
:type :primary {:accessibility-label :continue-button
:disabled? (not valid-ens-or-address?) :type :primary
:on-press #(rf/dispatch :disabled? (not valid-ens-or-address?)
[:wallet/select-send-address :on-press #(rf/dispatch
{:address (or local-suggestion-address [:wallet/select-send-address
@input-value) {:address (or
:stack-id local-suggestion-address
:screen/wallet.select-address}]) @input-value)
:customization-color color} :stack-id
(i18n/label :t/continue)])} :screen/wallet.select-address}])
:customization-color color}
(i18n/label :t/continue)])}
[quo/page-top [quo/page-top
{:title (i18n/label :t/send-to) {:title (i18n/label :t/send-to)
:title-accessibility-label :title-label}] :title-accessibility-label :title-label}]