-
Notifications
You must be signed in to change notification settings - Fork 986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#21198] Sync error button covered #21454
base: develop
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,32 +39,40 @@ | |
|
||
(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?)}}]) | ||
Comment on lines
-45
to
-63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I refactored this code, but it's very interesting. @ilmotta FYI, just in case you didn't know, this code has the following structure: {:foo 1
:bar 2
(if true :foo :x) 10
(if true :bar :y) 20} so weird, because this is invalid in Clojure, it throws (as expected), an exception due to duplicated keys, but in Clojurescript, it overrides the previously written keys: ;; =>
{:foo 10
:bar 20} as this may not work in a future release (idk) I refactored to be Clojure-valid There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strange indeed @ulisesmac. If we see this type of code we can make an effort to refactor if possible because we have other ways, like using |
||
(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?] | ||
|
@@ -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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used the safe area for the top