From 9e9833e7326da320cf464c247ab5bd3e9cf8595b Mon Sep 17 00:00:00 2001 From: Ulises M Date: Wed, 16 Oct 2024 22:57:11 -0600 Subject: [PATCH] WIP: fix spacing and code style --- .../onboarding/syncing/progress/style.cljs | 21 +++--- .../onboarding/syncing/progress/view.cljs | 69 ++++++++++--------- 2 files changed, 49 insertions(+), 41 deletions(-) diff --git a/src/status_im/contexts/onboarding/syncing/progress/style.cljs b/src/status_im/contexts/onboarding/syncing/progress/style.cljs index f5da77a634..48657df787 100644 --- a/src/status_im/contexts/onboarding/syncing/progress/style.cljs +++ b/src/status_im/contexts/onboarding/syncing/progress/style.cljs @@ -1,6 +1,7 @@ (ns status-im.contexts.onboarding.syncing.progress.style (:require - [quo.foundations.colors :as colors])) + [quo.foundations.colors :as colors] + [react-native.safe-area :as safe-area])) (def absolute-fill {:position :absolute @@ -11,14 +12,16 @@ (defn page-container [in-onboarding?] - {:flex 1 - :position :absolute - :top 0 - :bottom 0 - :left 0 - :right 0 - :padding-bottom 20 - :background-color (when-not in-onboarding? colors/neutral-80-opa-80-blur)}) + (let [{:keys [top bottom]} (safe-area/get-insets)] + {:flex 1 + :position :absolute + :top 0 + :bottom 0 + :left 0 + :right 0 + :padding-top top + :padding-bottom bottom + :background-color (when-not in-onboarding? colors/neutral-80-opa-80-blur)})) (defn page-illustration [width] diff --git a/src/status_im/contexts/onboarding/syncing/progress/view.cljs b/src/status_im/contexts/onboarding/syncing/progress/view.cljs index 08aa1256a0..9805874e2d 100644 --- a/src/status_im/contexts/onboarding/syncing/progress/view.cljs +++ b/src/status_im/contexts/onboarding/syncing/progress/view.cljs @@ -15,16 +15,13 @@ (defn page-title [pairing-progress?] - [quo/text-combinations - {:container-style {:margin-top 56 :margin-horizontal 20} - :title (i18n/label (if pairing-progress? - :t/sync-devices-title - :t/sync-devices-error-title)) - :description (i18n/label (if pairing-progress? - :t/sync-devices-sub-title - :t/sync-devices-error-sub-title)) - :title-accessibility-label :progress-screen-title - :description-accessibility-label :progress-screen-sub-title}]) + [quo/page-top {:title (i18n/label (if pairing-progress? + :t/sync-devices-title + :t/sync-devices-error-title)) + :description :text + :description-text (i18n/label (if pairing-progress? + :t/sync-devices-sub-title + :t/sync-devices-error-sub-title))}]) (defn- navigate-to-enter-seed-phrase [] @@ -42,38 +39,46 @@ (defn try-again-button [profile-color logged-in?] - [quo/bottom-actions - {:actions (if logged-in? :one-action :two-actions) - :blur? true - :button-one-label (i18n/label :t/recovery-phrase) - :button-one-props {:type :primary - :accessibility-label :try-seed-phrase-button - :customization-color profile-color - :container-style {:flex 1} - :size 40 - :on-press navigate-to-enter-seed-phrase} - (if logged-in? :button-one-label :button-two-label) - (i18n/label :t/try-again) - (if logged-in? :button-one-props :button-two-props) - {:type (if logged-in? :primary :grey) - :accessibility-label :try-again-later-button - :customization-color profile-color - :container-style {:flex 1} - :size 40 - :on-press #(try-again logged-in?)}}]) + (let [number-of-actions (if logged-in? :one-action :two-actions) + try-again-label (i18n/label :t/try-again) + try-again-props {:type (if logged-in? :primary :grey) + :accessibility-label :try-again-later-button + :customization-color profile-color + :container-style {:flex 1} + :size 40 + :on-press #(try-again logged-in?)} + recovery-phrase-label (i18n/label :t/recovery-phrase) + recovery-phrase-props {:type :primary + :accessibility-label :try-seed-phrase-button + :customization-color profile-color + :container-style {:flex 1} + :size 40 + :on-press navigate-to-enter-seed-phrase} + buttons (if logged-in? + {:button-one-label try-again-label + :button-one-props try-again-props} + {:button-one-label recovery-phrase-label + :button-one-props recovery-phrase-props + :button-two-label try-again-label + :button-two-props try-again-props})] + [quo/bottom-actions (assoc buttons + :actions number-of-actions + :blur? true)])) (defn- illustration [pairing-progress?] [rn/image {:resize-mode :contain :style (style/page-illustration (:width (rn/get-window))) - :source (resources/get-image (if pairing-progress? :syncing-devices :syncing-wrong))}]) + :source (resources/get-image (if pairing-progress? + :syncing-devices + :syncing-wrong))}]) (defn view [in-onboarding?] (let [pairing-status (rf/sub [:pairing/pairing-status]) logged-in? (rf/sub [:multiaccount/logged-in?]) - pairing-progress? (pairing-progress pairing-status) + pairing-progress? false ;(pairing-progress pairing-status) profile-color (or (:color (rf/sub [:onboarding/profile])) (rf/sub [:profile/customization-color]))] [rn/view {:style (style/page-container in-onboarding?)} @@ -83,7 +88,7 @@ [quo/page-nav {:type :no-title :background :blur}] [page-title pairing-progress?] [illustration pairing-progress?] - (when-not (pairing-progress pairing-status) + (when-not pairing-progress? [try-again-button profile-color logged-in?])])) (defn view-onboarding