mirror of
https://github.com/status-im/status-react.git
synced 2025-02-16 12:59:38 +00:00
Remove onboarding generating keys screen (#21608)
This commit is contained in:
parent
76d6825dd5
commit
0f00f8439f
@ -450,7 +450,6 @@
|
|||||||
(def ^:const biometrics-type-touch-id :TouchID)
|
(def ^:const biometrics-type-touch-id :TouchID)
|
||||||
(def ^:const biometrics-type-face-id :FaceID)
|
(def ^:const biometrics-type-face-id :FaceID)
|
||||||
|
|
||||||
(def ^:const onboarding-generating-keys-animation-duration-ms 7000)
|
|
||||||
(def ^:const onboarding-generating-keys-navigation-retry-ms 3000)
|
(def ^:const onboarding-generating-keys-navigation-retry-ms 3000)
|
||||||
|
|
||||||
(def ^:const image-description-in-lightbox? false)
|
(def ^:const image-description-in-lightbox? false)
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
(fn []
|
(fn []
|
||||||
(reanimated/set-shared-value @paused? (not= view-id :screen/onboarding.intro))
|
(reanimated/set-shared-value @paused? (not= view-id :screen/onboarding.intro))
|
||||||
(fn []
|
(fn []
|
||||||
(when (= view-id :screen/onboarding.generating-keys)
|
(when (= view-id :screen/onboarding.preparing-status)
|
||||||
(carousel.animation/cleanup-animation progress paused?))))
|
(carousel.animation/cleanup-animation progress paused?))))
|
||||||
[view-id])
|
[view-id])
|
||||||
|
|
||||||
|
@ -67,28 +67,6 @@
|
|||||||
(fn [_ [error]]
|
(fn [_ [error]]
|
||||||
{:dispatch [:biometric/show-message (ex-cause error)]}))
|
{:dispatch [:biometric/show-message (ex-cause error)]}))
|
||||||
|
|
||||||
;; Navigate to next screen once onboarding animation and account creation both are complete
|
|
||||||
;; Note: If account creation fails, user will get stuck on loading screen
|
|
||||||
;; TODO: Show error screen in case account creation/restoration fails
|
|
||||||
(rf/reg-event-fx :onboarding/account-creation-complete
|
|
||||||
(fn [{:keys [db]} [opts]]
|
|
||||||
(let [loading-animation-complete? (or (:loading-animation-complete? opts)
|
|
||||||
(:onboarding/loading-animation-complete? db))
|
|
||||||
loading-screen (or (:loading-screen opts) (:onboarding/loading-screen db))
|
|
||||||
login-signal-received? (or (:login-signal-received? opts)
|
|
||||||
(:onboarding/login-signal-received? db))]
|
|
||||||
(if (and loading-animation-complete? login-signal-received?)
|
|
||||||
{:db (-> db
|
|
||||||
(dissoc :onboarding/loading-screen)
|
|
||||||
(dissoc :onboarding/loading-animation-complete?)
|
|
||||||
(dissoc :onboarding/login-signal-received?))
|
|
||||||
:fx [[:dispatch
|
|
||||||
[:navigate-to-within-stack [:screen/onboarding.enable-notifications loading-screen]]]]}
|
|
||||||
{:db (-> db
|
|
||||||
(assoc :onboarding/loading-screen loading-screen)
|
|
||||||
(assoc :onboarding/loading-animation-complete? loading-animation-complete?)
|
|
||||||
(assoc :onboarding/login-signal-received? login-signal-received?))}))))
|
|
||||||
|
|
||||||
(rf/defn create-account-and-login
|
(rf/defn create-account-and-login
|
||||||
{:events [:onboarding/create-account-and-login]}
|
{:events [:onboarding/create-account-and-login]}
|
||||||
[{:keys [db] :as cofx}]
|
[{:keys [db] :as cofx}]
|
||||||
@ -96,27 +74,20 @@
|
|||||||
(:onboarding/profile db)
|
(:onboarding/profile db)
|
||||||
syncing-account-recovered? (and (seq (:syncing/key-uid db))
|
syncing-account-recovered? (and (seq (:syncing/key-uid db))
|
||||||
(= (:syncing/key-uid db)
|
(= (:syncing/key-uid db)
|
||||||
(get-in db [:onboarding/profile :key-uid])))
|
(get-in db [:onboarding/profile :key-uid])))]
|
||||||
loading-screen (if syncing-account-recovered?
|
|
||||||
:screen/onboarding.preparing-status
|
|
||||||
:screen/onboarding.generating-keys)]
|
|
||||||
(rf/merge cofx
|
(rf/merge cofx
|
||||||
{:fx [[:dispatch
|
{:fx [[:dispatch
|
||||||
[:navigate-to-within-stack
|
[:navigate-to-within-stack
|
||||||
[loading-screen
|
[:screen/onboarding.preparing-status
|
||||||
(get db
|
(get db
|
||||||
:onboarding/navigated-to-enter-seed-phrase-from-screen
|
:onboarding/navigated-to-enter-seed-phrase-from-screen
|
||||||
:screen/onboarding.new-to-status)]]]
|
:screen/onboarding.new-to-status)]]]
|
||||||
(when-not syncing-account-recovered?
|
(when-not syncing-account-recovered?
|
||||||
[:dispatch [:syncing/clear-syncing-installation-id]])]
|
[:dispatch [:syncing/clear-syncing-installation-id]])]
|
||||||
:dispatch-later [{:ms constants/onboarding-generating-keys-animation-duration-ms
|
:db (-> db
|
||||||
:dispatch [:onboarding/account-creation-complete
|
(dissoc :profile/login)
|
||||||
{:loading-animation-complete? true
|
(dissoc :auth-method)
|
||||||
:loading-screen loading-screen}]}]
|
(assoc :onboarding/new-account? true))}
|
||||||
:db (-> db
|
|
||||||
(dissoc :profile/login)
|
|
||||||
(dissoc :auth-method)
|
|
||||||
(assoc :onboarding/new-account? true))}
|
|
||||||
(if seed-phrase
|
(if seed-phrase
|
||||||
(profile.recover/recover-profile-and-login profile)
|
(profile.recover/recover-profile-and-login profile)
|
||||||
(profile.create/create-profile-and-login profile)))))
|
(profile.create/create-profile-and-login profile)))))
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
(ns status-im.contexts.onboarding.generating-keys.style)
|
|
||||||
|
|
||||||
(defn page-container
|
|
||||||
[insets]
|
|
||||||
{:flex 1
|
|
||||||
:padding-top (:top insets)})
|
|
||||||
|
|
||||||
(defn page-illustration
|
|
||||||
[width]
|
|
||||||
{:flex 1
|
|
||||||
:width width})
|
|
||||||
|
|
||||||
(def title-style
|
|
||||||
{:position :absolute
|
|
||||||
:left 0
|
|
||||||
:right 0
|
|
||||||
:top 0})
|
|
@ -1,105 +0,0 @@
|
|||||||
(ns status-im.contexts.onboarding.generating-keys.view
|
|
||||||
(:require
|
|
||||||
[quo.core :as quo]
|
|
||||||
[react-native.core :as rn]
|
|
||||||
[react-native.reanimated :as reanimated]
|
|
||||||
[react-native.safe-area :as safe-area]
|
|
||||||
[status-im.common.resources :as resources]
|
|
||||||
[status-im.contexts.onboarding.generating-keys.style :as style]
|
|
||||||
[utils.i18n :as i18n]))
|
|
||||||
|
|
||||||
(def first-title-display-time 3000)
|
|
||||||
(def second-title-start-time 3500)
|
|
||||||
(def second-title-display-time 1000)
|
|
||||||
(def third-title-start-time 5500)
|
|
||||||
(def transition-duration-time 500)
|
|
||||||
|
|
||||||
(defn generate-keys-title
|
|
||||||
[]
|
|
||||||
[quo/text-combinations
|
|
||||||
{:container-style {:margin-horizontal 20
|
|
||||||
:margin-vertical 12}
|
|
||||||
:title (i18n/label :t/generating-keys)}])
|
|
||||||
|
|
||||||
(defn saving-keys-title
|
|
||||||
[]
|
|
||||||
[quo/text-combinations
|
|
||||||
{:container-style {:margin-horizontal 20
|
|
||||||
:margin-vertical 12}
|
|
||||||
:title (i18n/label :t/saving-keys-to-device)}])
|
|
||||||
|
|
||||||
(defn keys-saved-title
|
|
||||||
[]
|
|
||||||
[quo/text-combinations
|
|
||||||
{:container-style {:margin-horizontal 20
|
|
||||||
:margin-vertical 12}
|
|
||||||
:title (i18n/label :t/keys-saved)}])
|
|
||||||
|
|
||||||
(defn sequence-animation
|
|
||||||
[generate-keys-opacity saving-keys-opacity keys-saved-opacity]
|
|
||||||
(reanimated/set-shared-value generate-keys-opacity
|
|
||||||
(reanimated/with-delay
|
|
||||||
first-title-display-time
|
|
||||||
(reanimated/with-timing 0
|
|
||||||
(js-obj "duration" transition-duration-time
|
|
||||||
"easing" (:linear
|
|
||||||
reanimated/easings)))))
|
|
||||||
(reanimated/set-shared-value
|
|
||||||
saving-keys-opacity
|
|
||||||
(reanimated/with-sequence
|
|
||||||
(reanimated/with-delay second-title-start-time
|
|
||||||
(reanimated/with-timing 1
|
|
||||||
(js-obj "duration" transition-duration-time
|
|
||||||
"easing" (:linear reanimated/easings))))
|
|
||||||
(reanimated/with-delay second-title-display-time
|
|
||||||
(reanimated/with-timing 0
|
|
||||||
(js-obj "duration" transition-duration-time
|
|
||||||
"easing" (:linear reanimated/easings))))))
|
|
||||||
(reanimated/set-shared-value keys-saved-opacity
|
|
||||||
(reanimated/with-delay
|
|
||||||
third-title-start-time
|
|
||||||
(reanimated/with-timing 1
|
|
||||||
(js-obj "duration" transition-duration-time
|
|
||||||
"easing" (:linear
|
|
||||||
reanimated/easings))))))
|
|
||||||
|
|
||||||
(defn title
|
|
||||||
[]
|
|
||||||
(let [generate-keys-opacity (reanimated/use-shared-value 1)
|
|
||||||
saving-keys-opacity (reanimated/use-shared-value 0)
|
|
||||||
keys-saved-opacity (reanimated/use-shared-value 0)]
|
|
||||||
(sequence-animation generate-keys-opacity saving-keys-opacity keys-saved-opacity)
|
|
||||||
[rn/view
|
|
||||||
{:style {:margin-top 56
|
|
||||||
:height 56}}
|
|
||||||
[reanimated/view
|
|
||||||
{:style (reanimated/apply-animations-to-style
|
|
||||||
{:opacity generate-keys-opacity}
|
|
||||||
style/title-style)}
|
|
||||||
[generate-keys-title]]
|
|
||||||
[reanimated/view
|
|
||||||
{:style (reanimated/apply-animations-to-style
|
|
||||||
{:opacity saving-keys-opacity}
|
|
||||||
style/title-style)}
|
|
||||||
[saving-keys-title]]
|
|
||||||
[reanimated/view
|
|
||||||
{:style (reanimated/apply-animations-to-style
|
|
||||||
{:opacity keys-saved-opacity}
|
|
||||||
style/title-style)}
|
|
||||||
[keys-saved-title]]]))
|
|
||||||
|
|
||||||
(defn content
|
|
||||||
[]
|
|
||||||
(let [width (:width (rn/get-window))]
|
|
||||||
[rn/image
|
|
||||||
{:resize-mode :contain
|
|
||||||
:style (style/page-illustration width)
|
|
||||||
:source (resources/get-image :generate-keys1)}]))
|
|
||||||
|
|
||||||
(defn view
|
|
||||||
[]
|
|
||||||
(let [insets (safe-area/get-insets)]
|
|
||||||
[rn/view {:style (style/page-container insets)}
|
|
||||||
[:<>
|
|
||||||
[title]
|
|
||||||
[content]]]))
|
|
@ -4,7 +4,7 @@
|
|||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
[react-native.safe-area :as safe-area]
|
[react-native.safe-area :as safe-area]
|
||||||
[status-im.common.resources :as resources]
|
[status-im.common.resources :as resources]
|
||||||
[status-im.contexts.onboarding.generating-keys.style :as style]
|
[status-im.contexts.onboarding.preparing-status.style :as style]
|
||||||
[utils.i18n :as i18n]))
|
[utils.i18n :as i18n]))
|
||||||
|
|
||||||
(defn title
|
(defn title
|
||||||
@ -16,7 +16,7 @@
|
|||||||
[quo/text-combinations
|
[quo/text-combinations
|
||||||
{:container-style {:margin-horizontal 20
|
{:container-style {:margin-horizontal 20
|
||||||
:margin-vertical 12}
|
:margin-vertical 12}
|
||||||
:title (i18n/label :t/preparing-app-for-you)
|
:title (i18n/label :t/preparing-status-for-you)
|
||||||
:description (i18n/label :t/hang-in-there)}]])
|
:description (i18n/label :t/hang-in-there)}]])
|
||||||
|
|
||||||
(defn content
|
(defn content
|
||||||
|
@ -85,7 +85,10 @@
|
|||||||
|
|
||||||
(get db :onboarding/new-account?)
|
(get db :onboarding/new-account?)
|
||||||
[[:dispatch [:onboarding/finalize-setup]]
|
[[:dispatch [:onboarding/finalize-setup]]
|
||||||
[:dispatch [:onboarding/account-creation-complete {:login-signal-received? true}]]]
|
[:dispatch
|
||||||
|
[:navigate-to-within-stack
|
||||||
|
[:screen/onboarding.enable-notifications
|
||||||
|
:screen/onboarding.preparing-status]]]]
|
||||||
|
|
||||||
:else
|
:else
|
||||||
[[:dispatch [:update-theme-and-init-root :shell-stack]]
|
[[:dispatch [:update-theme-and-init-root :shell-stack]]
|
||||||
|
@ -45,7 +45,6 @@
|
|||||||
[status-im.contexts.onboarding.create-profile.view :as create-profile]
|
[status-im.contexts.onboarding.create-profile.view :as create-profile]
|
||||||
[status-im.contexts.onboarding.enable-biometrics.view :as enable-biometrics]
|
[status-im.contexts.onboarding.enable-biometrics.view :as enable-biometrics]
|
||||||
[status-im.contexts.onboarding.enable-notifications.view :as enable-notifications]
|
[status-im.contexts.onboarding.enable-notifications.view :as enable-notifications]
|
||||||
[status-im.contexts.onboarding.generating-keys.view :as generating-keys]
|
|
||||||
[status-im.contexts.onboarding.identifiers.view :as identifiers]
|
[status-im.contexts.onboarding.identifiers.view :as identifiers]
|
||||||
[status-im.contexts.onboarding.intro.view :as intro]
|
[status-im.contexts.onboarding.intro.view :as intro]
|
||||||
[status-im.contexts.onboarding.preparing-status.view :as preparing-status]
|
[status-im.contexts.onboarding.preparing-status.view :as preparing-status]
|
||||||
@ -761,17 +760,6 @@
|
|||||||
:popStackOnPress false}}
|
:popStackOnPress false}}
|
||||||
:component enable-biometrics/view})
|
:component enable-biometrics/view})
|
||||||
|
|
||||||
(def onboarding-generating-keys
|
|
||||||
{:name :screen/onboarding.generating-keys
|
|
||||||
:metrics {:track? true}
|
|
||||||
:options {:theme :dark
|
|
||||||
:layout options/onboarding-transparent-layout
|
|
||||||
:animations transitions/push-animations-for-transparent-background
|
|
||||||
:popGesture false
|
|
||||||
:hardwareBackButton {:dismissModalOnPress false
|
|
||||||
:popStackOnPress false}}
|
|
||||||
:component generating-keys/view})
|
|
||||||
|
|
||||||
(def onboarding-preparing-status
|
(def onboarding-preparing-status
|
||||||
{:name :screen/onboarding.preparing-status
|
{:name :screen/onboarding.preparing-status
|
||||||
:metrics {:track? true}
|
:metrics {:track? true}
|
||||||
@ -872,7 +860,6 @@
|
|||||||
onboarding-create-profile
|
onboarding-create-profile
|
||||||
onboarding-create-profile-password
|
onboarding-create-profile-password
|
||||||
onboarding-enable-biometrics
|
onboarding-enable-biometrics
|
||||||
onboarding-generating-keys
|
|
||||||
onboarding-preparing-status
|
onboarding-preparing-status
|
||||||
onboarding-entering-seed-phrase
|
onboarding-entering-seed-phrase
|
||||||
onboarding-enable-notifications
|
onboarding-enable-notifications
|
||||||
|
@ -1975,7 +1975,7 @@
|
|||||||
"powered-by-paraswap": "Powered by Paraswap",
|
"powered-by-paraswap": "Powered by Paraswap",
|
||||||
"preference": "Preference",
|
"preference": "Preference",
|
||||||
"preferred-by-receiver": "Preferred by receiver",
|
"preferred-by-receiver": "Preferred by receiver",
|
||||||
"preparing-app-for-you": "Preparing app for you...",
|
"preparing-status-for-you": "Preparing Status for you...",
|
||||||
"press": "Press",
|
"press": "Press",
|
||||||
"preview-privacy": "Preview privacy mode",
|
"preview-privacy": "Preview privacy mode",
|
||||||
"previewing-may-share-metadata": "Previewing links from these websites may share your metadata with their owners",
|
"previewing-may-share-metadata": "Previewing links from these websites may share your metadata with their owners",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user