|
1 | 1 | (ns status-im2.contexts.onboarding.enable-biometrics.view
|
2 |
| - (:require |
3 |
| - [quo.core :as quo] |
4 |
| - [react-native.core :as rn] |
5 |
| - [react-native.safe-area :as safe-area] |
6 |
| - [status-im2.common.biometric.events :as biometric] |
7 |
| - [status-im2.common.parallax.view :as parallax] |
8 |
| - [status-im2.common.parallax.whitelist :as whitelist] |
9 |
| - [status-im2.common.resources :as resources] |
10 |
| - [status-im2.contexts.onboarding.enable-biometrics.style :as style] |
11 |
| - [utils.i18n :as i18n] |
12 |
| - [utils.re-frame :as rf])) |
| 2 | + (:require [quo.core :as quo] |
| 3 | + [react-native.core :as rn] |
| 4 | + [react-native.safe-area :as safe-area] |
| 5 | + [status-im2.common.biometric.events :as biometric] |
| 6 | + [status-im2.common.parallax.view :as parallax] |
| 7 | + [status-im2.common.parallax.whitelist :as whitelist] |
| 8 | + [status-im2.common.resources :as resources] |
| 9 | + [status-im2.contexts.onboarding.enable-biometrics.style :as style] |
| 10 | + [status-im2.navigation.state :as state] |
| 11 | + [utils.i18n :as i18n] |
| 12 | + [utils.re-frame :as rf])) |
13 | 13 |
|
14 | 14 | (defn page-title
|
15 | 15 | []
|
|
24 | 24 | [insets]
|
25 | 25 | (let [supported-biometric-type (rf/sub [:biometric/supported-type])
|
26 | 26 | bio-type-label (biometric/get-label-by-type supported-biometric-type)
|
27 |
| - profile-color (:color (rf/sub [:onboarding-2/profile]))] |
| 27 | + profile-color (or (:color (rf/sub [:onboarding-2/profile])) |
| 28 | + (rf/sub [:profile/customization-color]))] |
28 | 29 | [rn/view {:style (style/buttons insets)}
|
29 | 30 | [quo/button
|
30 | 31 | {:accessibility-label :enable-biometrics-button
|
|
36 | 37 | {:accessibility-label :maybe-later-button
|
37 | 38 | :background :blur
|
38 | 39 | :type :grey
|
39 |
| - :on-press #(rf/dispatch [:onboarding-2/create-account-and-login]) |
40 |
| - :container-style {:margin-top 12}} |
41 |
| - (i18n/label :t/maybe-later)]])) |
| 40 | + :on-press #(rf/dispatch (if (= :syncing-results @state/root-id) |
| 41 | + [:navigate-to-within-stack |
| 42 | + [:enable-notifications :enable-biometrics]] |
| 43 | + [:onboarding-2/create-account-and-login])) |
| 44 | + :container-style {:margin-top 12}} (i18n/label :t/maybe-later)]])) |
42 | 45 |
|
43 | 46 | (defn enable-biometrics-parallax
|
44 | 47 | []
|
45 | 48 | (let [stretch (if rn/small-screen? 25 40)]
|
46 | 49 | [parallax/video
|
47 |
| - {:layers (:biometrics resources/parallax-video) |
48 |
| - :stretch stretch}])) |
| 50 | + {:layers (:biometrics resources/parallax-video) :stretch stretch}])) |
49 | 51 |
|
50 | 52 | (defn enable-biometrics-simple
|
51 | 53 | []
|
|
58 | 60 | (defn enable-biometrics
|
59 | 61 | []
|
60 | 62 | (let [insets (safe-area/get-insets)]
|
61 |
| - [rn/view {:style (style/page-container insets)} |
62 |
| - [page-title] |
| 63 | + [rn/view {:style (style/page-container insets)} [page-title] |
63 | 64 | (if whitelist/whitelisted?
|
64 | 65 | [enable-biometrics-parallax]
|
65 |
| - [enable-biometrics-simple]) |
66 |
| - [enable-biometrics-buttons insets]])) |
| 66 | + [enable-biometrics-simple]) [enable-biometrics-buttons insets]])) |
0 commit comments