fix: fix slide button padding on transaction confirmation page (#18585)

Signed-off-by: Brian Sztamfater <brian@status.im>
This commit is contained in:
Brian Sztamfater 2024-01-24 10:40:53 -03:00 committed by GitHub
parent ebbae051bd
commit d20f10cf8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 69 additions and 63 deletions

View File

@ -52,7 +52,8 @@
:remove-listeners remove-listeners})) :remove-listeners remove-listeners}))
(defn view (defn view
[{:keys [header footer customization-color gradient-cover?]} & [{:keys [header footer customization-color footer-container-padding gradient-cover?]
:or {footer-container-padding (safe-area/get-top)}} &
children] children]
(reagent/with-let [window-height (:height (rn/get-window)) (reagent/with-let [window-height (:height (rn/get-window))
footer-container-height (reagent/atom 0) footer-container-height (reagent/atom 0)
@ -94,7 +95,7 @@
children)] children)]
[rn/keyboard-avoiding-view [rn/keyboard-avoiding-view
{:style style/keyboard-avoiding-view {:style style/keyboard-avoiding-view
:keyboard-vertical-offset (if platform/ios? (safe-area/get-top) 0) :keyboard-vertical-offset (if platform/ios? footer-container-padding 0)
:pointer-events :box-none} :pointer-events :box-none}
[floating-container/view [floating-container/view
{:on-layout set-footer-container-height {:on-layout set-footer-container-height

View File

@ -122,17 +122,17 @@
(rf/dispatch [:wallet/clean-scanned-address]) (rf/dispatch [:wallet/clean-scanned-address])
(rf/dispatch [:wallet/clear-address-activity-check]) (rf/dispatch [:wallet/clear-address-activity-check])
(rf/dispatch [:navigate-back]))}] (rf/dispatch [:navigate-back]))}]
:footer :footer [quo/button
[quo/button {:customization-color customization-color
{:customization-color customization-color :disabled? (or (string/blank? @input-value)
:disabled? (or (string/blank? @input-value) (some? (validate @input-value))) (some? (validate @input-value)))
:on-press (fn [] :on-press (fn []
(rf/dispatch [:navigate-to (rf/dispatch [:navigate-to
:confirm-address-to-watch :confirm-address-to-watch
{:address @input-value}]) {:address @input-value}])
(clear-input)) (clear-input))
:container-style {:z-index 2}} :container-style {:z-index 2}}
(i18n/label :t/continue)]} (i18n/label :t/continue)]}
[quo/text-combinations [quo/text-combinations
{:container-style style/header-container {:container-style style/header-container
:title (i18n/label :t/add-address) :title (i18n/label :t/add-address)

View File

@ -135,21 +135,23 @@
(rf/dispatch [:wallet/clean-scanned-address]) (rf/dispatch [:wallet/clean-scanned-address])
(rf/dispatch [:wallet/clean-local-suggestions])))) (rf/dispatch [:wallet/clean-local-suggestions]))))
[floating-button-page/view [floating-button-page/view
{:header [account-switcher/view {:footer-container-padding 0
{: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 [:wallet/select-send-address :disabled? (not valid-ens-or-address?)
{:address @input-value :on-press #(rf/dispatch [:wallet/select-send-address
:token token {:address @input-value
:stack-id :wallet-select-address}]) :token token
:customization-color color} :stack-id
(i18n/label :t/continue)])} :wallet-select-address}])
:customization-color color}
(i18n/label :t/continue)])}
[quo/text-combinations [quo/text-combinations
{:title (i18n/label :t/send-to) {:title (i18n/label :t/send-to)
:container-style style/title-container :container-style style/title-container

View File

@ -162,28 +162,30 @@
:address (utils/get-shortened-address to-address)}] :address (utils/get-shortened-address to-address)}]
[rn/view {:style {:flex 1}} [rn/view {:style {:flex 1}}
[floating-button-page/view [floating-button-page/view
{:header [quo/page-nav {:footer-container-padding 0
{:icon-name :i/arrow-left :header [quo/page-nav
:on-press on-close {:icon-name :i/arrow-left
:margin-top (safe-area/get-top) :on-press on-close
:background :blur :margin-top (safe-area/get-top)
:accessibility-label :top-bar :background :blur
:right-side [{:icon-name :i/advanced :accessibility-label :top-bar
:on-press #(js/alert :right-side [{:icon-name :i/advanced
"to be implemented") :on-press #(js/alert
:accessibility-label :advanced-options}]}] "to be implemented")
:footer (if route :accessibility-label :advanced-options}]}]
[standard-auth/slide-button :footer (if route
{:size :size-48 [standard-auth/slide-button
:track-text (i18n/label :t/slide-to-send) {:size :size-48
:container-style {:z-index 2} :track-text (i18n/label :t/slide-to-send)
:customization-color account-color :container-style {:z-index 2}
:on-auth-success #(rf/dispatch [:wallet/send-transaction :customization-color account-color
(security/safe-unmask-data %)]) :on-auth-success #(rf/dispatch [:wallet/send-transaction
:auth-button-label (i18n/label :t/confirm)}] (security/safe-unmask-data
[rn/activity-indicator]) %)])
:gradient-cover? true :auth-button-label (i18n/label :t/confirm)}]
:customization-color (:color account)} [rn/activity-indicator])
:gradient-cover? true
:customization-color (:color account)}
[rn/view [rn/view
[transaction-title [transaction-title
{:token-symbol token-symbol {:token-symbol token-symbol

View File

@ -32,19 +32,20 @@
(fn [] (fn []
(let [transaction-details (rf/sub [:wallet/send-transaction-progress])] (let [transaction-details (rf/sub [:wallet/send-transaction-progress])]
[floating-button-page/view [floating-button-page/view
{:header [quo/page-nav {:footer-container-padding 0
{:type :no-title :header [quo/page-nav
:background :blur {:type :no-title
:icon-name :i/close :background :blur
:margin-top (safe-area/get-top) :icon-name :i/close
:on-press leave-page :margin-top (safe-area/get-top)
:accessibility-label :top-bar}] :on-press leave-page
:footer [quo/button :accessibility-label :top-bar}]
{:customization-color color :footer [quo/button
:on-press leave-page} {:customization-color color
(i18n/label :t/done)] :on-press leave-page}
:customization-color color (i18n/label :t/done)]
:gradient-cover? true} :customization-color color
:gradient-cover? true}
[rn/view {:style style/content-container} [rn/view {:style style/content-container}
[rn/image [rn/image
{:source (resources/get-image :transaction-progress) {:source (resources/get-image :transaction-progress)