|
5 | 5 | [status-im.common.resources :as resources]
|
6 | 6 | [status-im.contexts.onboarding.common.background.view :as background]
|
7 | 7 | [status-im.contexts.onboarding.syncing.progress.style :as style]
|
| 8 | + [utils.debounce :as debounce] |
8 | 9 | [utils.i18n :as i18n]
|
9 | 10 | [utils.re-frame :as rf]))
|
10 | 11 |
|
|
25 | 26 | :title-accessibility-label :progress-screen-title
|
26 | 27 | :description-accessibility-label :progress-screen-sub-title}])
|
27 | 28 |
|
| 29 | +(defn navigate-to-enter-seed-phrase |
| 30 | + [] |
| 31 | + (rf/dispatch [:navigate-back-to :screen/onboarding.sync-or-recover-profile]) |
| 32 | + (debounce/debounce-and-dispatch |
| 33 | + [:onboarding/navigate-to-sign-in-by-seed-phrase :screen/onboarding.sync-or-recover-profile] |
| 34 | + 300)) |
| 35 | + |
28 | 36 | (defn try-again-button
|
29 |
| - [profile-color] |
30 |
| - [quo/button |
31 |
| - {:on-press (fn [] |
32 |
| - (rf/dispatch [:syncing/clear-states]) |
33 |
| - (rf/dispatch [:navigate-back])) |
34 |
| - :accessibility-label :try-again-later-button |
35 |
| - :customization-color profile-color |
36 |
| - :size 40 |
37 |
| - :container-style style/try-again-button} |
38 |
| - (i18n/label :t/try-again)]) |
| 37 | + [profile-color logged-in?] |
| 38 | + [rn/view |
| 39 | + (when-not logged-in? |
| 40 | + [quo/button |
| 41 | + {:on-press navigate-to-enter-seed-phrase |
| 42 | + :accessibility-label :try-seed-phrase-button |
| 43 | + :customization-color profile-color |
| 44 | + :container-style style/try-again-button} |
| 45 | + (i18n/label :t/enter-seed-phrase)]) |
| 46 | + [quo/button |
| 47 | + {:on-press (fn [] |
| 48 | + (rf/dispatch [:syncing/clear-states]) |
| 49 | + (rf/dispatch [:navigate-back])) |
| 50 | + :accessibility-label :try-again-later-button |
| 51 | + :customization-color profile-color |
| 52 | + :size 40 |
| 53 | + :container-style style/try-again-button} |
| 54 | + (i18n/label :t/try-again)]]) |
39 | 55 |
|
40 | 56 | (defn- illustration
|
41 | 57 | [pairing-progress?]
|
|
47 | 63 | (defn view
|
48 | 64 | [in-onboarding?]
|
49 | 65 | (let [pairing-status (rf/sub [:pairing/pairing-status])
|
| 66 | + logged-in? (rf/sub [:multiaccount/logged-in?]) |
50 | 67 | pairing-progress? (pairing-progress pairing-status)
|
51 | 68 | profile-color (or (:color (rf/sub [:onboarding/profile]))
|
52 | 69 | (rf/sub [:profile/customization-color]))]
|
|
58 | 75 | [page-title pairing-progress?]
|
59 | 76 | [illustration pairing-progress?]
|
60 | 77 | (when-not (pairing-progress pairing-status)
|
61 |
| - [try-again-button profile-color])])) |
| 78 | + [try-again-button profile-color logged-in?])])) |
62 | 79 |
|
63 | 80 | (defn view-onboarding
|
64 | 81 | []
|
|
0 commit comments