From 85c051143742c1013ae4c15a4ceef033392fc9a0 Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Fri, 20 Dec 2024 15:49:18 +0530 Subject: [PATCH 1/2] Onboarding remove identifiers code and refactor create_or_sync_profile screen --- .../style.cljs | 2 +- .../onboarding/create_profile/view.cljs | 101 ++++++++++++++++ src/status_im/contexts/onboarding/events.cljs | 16 +-- .../identifiers/profile_card/style.cljs | 71 ------------ .../identifiers/profile_card/view.cljs | 64 ---------- .../onboarding/identifiers/style.cljs | 22 ---- .../contexts/onboarding/identifiers/view.cljs | 73 ------------ .../contexts/onboarding/intro/view.cljs | 4 +- .../view.cljs | 109 ++++-------------- .../onboarding/syncing/progress/view.cljs | 4 +- .../contexts/profile/profiles/view.cljs | 4 +- src/status_im/navigation/screens.cljs | 32 ++--- 12 files changed, 151 insertions(+), 351 deletions(-) rename src/status_im/contexts/onboarding/{create_or_sync_profile => create_profile}/style.cljs (86%) create mode 100644 src/status_im/contexts/onboarding/create_profile/view.cljs delete mode 100644 src/status_im/contexts/onboarding/identifiers/profile_card/style.cljs delete mode 100644 src/status_im/contexts/onboarding/identifiers/profile_card/view.cljs delete mode 100644 src/status_im/contexts/onboarding/identifiers/style.cljs delete mode 100644 src/status_im/contexts/onboarding/identifiers/view.cljs rename src/status_im/contexts/onboarding/{create_or_sync_profile => log_in}/view.cljs (51%) diff --git a/src/status_im/contexts/onboarding/create_or_sync_profile/style.cljs b/src/status_im/contexts/onboarding/create_profile/style.cljs similarity index 86% rename from src/status_im/contexts/onboarding/create_or_sync_profile/style.cljs rename to src/status_im/contexts/onboarding/create_profile/style.cljs index 0e853beebc8..599479ae018 100644 --- a/src/status_im/contexts/onboarding/create_or_sync_profile/style.cljs +++ b/src/status_im/contexts/onboarding/create_profile/style.cljs @@ -1,4 +1,4 @@ -(ns status-im.contexts.onboarding.create-or-sync-profile.style +(ns status-im.contexts.onboarding.create-profile.style (:require [quo.foundations.colors :as colors])) diff --git a/src/status_im/contexts/onboarding/create_profile/view.cljs b/src/status_im/contexts/onboarding/create_profile/view.cljs new file mode 100644 index 00000000000..d384e6842b8 --- /dev/null +++ b/src/status_im/contexts/onboarding/create_profile/view.cljs @@ -0,0 +1,101 @@ +(ns status-im.contexts.onboarding.create-profile.view + (:require + [quo.core :as quo] + re-frame.db + [react-native.core :as rn] + [react-native.safe-area :as safe-area] + [status-im.common.events-helper :as events-helper] + [status-im.common.resources :as resources] + [status-im.config :as config] + [status-im.contexts.onboarding.create-profile.style :as style] + [status-im.contexts.onboarding.getting-started-doc.view :as getting-started-doc] + [utils.debounce :as debounce] + [utils.i18n :as i18n] + [utils.re-frame :as rf])) + +(defn- navigate-to-create-profile-password + [] + (debounce/throttle-and-dispatch + [:onboarding/navigate-to-create-profile-password] + 1000)) + +(defn- navigate-to-sign-in-by-recovery-phrase + [] + (rf/dispatch [:syncing/clear-syncing-fallback-flow]) + (rf/dispatch [:onboarding/navigate-to-sign-in-by-seed-phrase :screen/onboarding.create-profile])) + +(defn- option-card-max-height + [window-height] + (- window-height + (* 2 56) ;; two other list items + (* 2 16) ;; spacing between items + 220)) ;; extra spacing (top bar) + +(defn- start-fresh-main-card + [window-height] + [quo/small-option-card + {:variant :main + :title (i18n/label :t/start-fresh) + :subtitle (i18n/label :t/start-fresh-subtitle) + :button-label (i18n/label :t/lets-go) + :accessibility-label :start-fresh-main-card + :image (resources/get-image :generate-keys) + :max-height (option-card-max-height window-height) + :on-press navigate-to-create-profile-password}]) + +(defn- use-recovery-phrase-icon-card + [] + [quo/small-option-card + {:variant :icon + :title (i18n/label :t/use-a-recovery-phrase) + :subtitle (i18n/label :t/use-a-recovery-phrase-subtitle) + :accessibility-label :use-a-recovery-phrase-icon-card + :image (resources/get-image :ethereum-address) + :on-press navigate-to-sign-in-by-recovery-phrase}]) + +(defn- use-empty-keycard-icon-card + [] + [quo/small-option-card + {:variant :icon + :title (i18n/label :t/use-an-empty-keycard) + :subtitle (i18n/label :t/use-an-empty-keycard-subtitle) + :accessibility-label :use-an-empty-keycard-icon-card + :image (resources/get-image :use-keycard) + :on-press #(rf/dispatch [:open-modal :screen/keycard.create-profile])}]) + +(defn- navigate-to-quo-preview + [] + (rf/dispatch [:navigate-to :quo-preview])) + +(defn view + [] + (let [{:keys [top]} (safe-area/get-insets) + window-height (rf/sub [:dimensions/window-height])] + [rn/view {:style style/content-container} + [quo/page-nav + {:margin-top top + :type :no-title + :background :blur + :icon-name :i/arrow-left + :on-press events-helper/navigate-back + :right-side [{:icon-name :i/info + :on-press getting-started-doc/show-as-bottom-sheet} + (when config/quo-preview-enabled? + {:icon-name :i/reveal-whitelist + :on-press navigate-to-quo-preview})]}] + [rn/view {:style style/options-container} + [quo/text + {:style style/title + :size :heading-1 + :weight :semi-bold} + (i18n/label :t/create-profile)] + [start-fresh-main-card window-height] + [rn/view {:style style/subtitle-container} + [quo/text + {:style style/subtitle + :size :paragraph-2 + :weight :medium} + (i18n/label :t/other-options)]] + [use-recovery-phrase-icon-card] + [rn/view {:style style/space-between-suboptions}] + [use-empty-keycard-icon-card]]])) diff --git a/src/status_im/contexts/onboarding/events.cljs b/src/status_im/contexts/onboarding/events.cljs index c48c8d6214b..0ba2c4ea292 100644 --- a/src/status_im/contexts/onboarding/events.cljs +++ b/src/status_im/contexts/onboarding/events.cljs @@ -25,7 +25,7 @@ (fn [{:keys [db]} [onboarding-data]] (let [navigate-from-screen (get db :onboarding/navigated-to-enter-seed-phrase-from-screen - :screen/onboarding.new-to-status)] + :screen/onboarding.create-profile)] {:db (update db :onboarding/profile merge onboarding-data) :fx [[:dispatch [:navigate-to-within-stack @@ -61,7 +61,7 @@ [:screen/onboarding.enable-notifications (get db :onboarding/navigated-to-enter-seed-phrase-from-screen - :screen/onboarding.new-to-status)]]})) + :screen/onboarding.create-profile)]]})) (rf/defn biometrics-done {:events [:onboarding/biometrics-done]} @@ -93,7 +93,7 @@ [:screen/onboarding.preparing-status (get db :onboarding/navigated-to-enter-seed-phrase-from-screen - :screen/onboarding.new-to-status)]]] + :screen/onboarding.create-profile)]]] (when-not syncing-account-recovered? [:dispatch [:syncing/clear-syncing-installation-id]]) (if seed-phrase @@ -115,7 +115,7 @@ (let [biometric-supported-type (get-in db [:biometrics :supported-type]) from-screen (get db :onboarding/navigated-to-enter-seed-phrase-from-screen - :screen/onboarding.new-to-status)] + :screen/onboarding.create-profile)] {:db (-> db (assoc-in [:onboarding/profile :password] masked-password) (assoc-in [:onboarding/profile :auth-method] constants/auth-method-password)) @@ -138,7 +138,7 @@ (let [next-screen :screen/onboarding.create-profile-password from-screen (get db :onboarding/navigated-to-enter-seed-phrase-from-screen - :screen/onboarding.new-to-status)] + :screen/onboarding.create-profile)] (if (contains? (:profile/profiles-overview db) key-uid) {:fx [[:effects.utils/show-confirmation {:title (i18n/label :t/multiaccount-exists-title) @@ -155,21 +155,21 @@ :fx [[:dispatch [:navigate-to-within-stack [next-screen from-screen]]]]})))) (rf/reg-event-fx - :onboarding/navigate-to-create-profile + :onboarding/navigate-to-create-profile-password (fn [{:keys [db]}] {:db (-> db (assoc-in [:onboarding/profile :color] (rand-nth colors/account-colors)) (update :onboarding/profile dissoc :image-path)) :fx [[:dispatch [:navigate-to-within-stack - [:screen/onboarding.create-profile-password :screen/onboarding.new-to-status]]]]})) + [:screen/onboarding.create-profile-password :screen/onboarding.create-profile]]]]})) (rf/reg-event-fx :onboarding/navigate-to-sign-in-by-syncing (fn [{:keys [db]}] ;; Restart the flow {:db (dissoc db :onboarding/profile) :dispatch [:navigate-to-within-stack - [:screen/onboarding.sign-in-intro :screen/onboarding.sync-or-recover-profile]]})) + [:screen/onboarding.sign-in-intro :screen/onboarding.log-in]]})) (rf/reg-event-fx :onboarding/set-auth-method (fn [{:keys [db]} [auth-method]] diff --git a/src/status_im/contexts/onboarding/identifiers/profile_card/style.cljs b/src/status_im/contexts/onboarding/identifiers/profile_card/style.cljs deleted file mode 100644 index ebc386e77e8..00000000000 --- a/src/status_im/contexts/onboarding/identifiers/profile_card/style.cljs +++ /dev/null @@ -1,71 +0,0 @@ -(ns status-im.contexts.onboarding.identifiers.profile-card.style - (:require - [quo.foundations.colors :as colors] - [quo.foundations.typography :as typography] - [react-native.reanimated :as reanimated])) - -(def card-view - {:margin-horizontal 20 - :margin-bottom :auto - :flex-direction :row}) - -(defn card-container - [background-color] - (reanimated/apply-animations-to-style - {:background-color background-color} - {:padding-horizontal 12 - :padding-top 12 - :padding-bottom 12 - :flex 1 - :border-radius 16})) - -(def card-header - {:flex-direction :row - :justify-content :space-between}) - -(defn avatar - [opacity] - (reanimated/apply-animations-to-style - {:opacity opacity} - {})) - -(defn mask-view - [opacity] - (reanimated/apply-animations-to-style - {:opacity opacity} - {:width 48 - :background-color :transparent - :height 48 - :border-color :black - :border-width 2 - :border-radius 44})) - -(def picture-avatar-mask - {:width 48 - :height 48 - :border-radius 48}) - -(defn user-name-container - [opacity] - (reanimated/apply-animations-to-style - {:opacity opacity} - {:flex-direction :row - :margin-top 8 - :align-items :center - :padding-right 12})) - -(def user-name - {:color colors/white}) - -(defn user-hash - [user-hash-color user-hash-opacity] - (reanimated/apply-animations-to-style - {:color user-hash-color - :opacity user-hash-opacity} - (merge typography/monospace - typography/paragraph-1 - {:margin-top 2}))) - -(def emoji-hash - {:margin-top 12 - :line-height 20.5}) diff --git a/src/status_im/contexts/onboarding/identifiers/profile_card/view.cljs b/src/status_im/contexts/onboarding/identifiers/profile_card/view.cljs deleted file mode 100644 index da189efcaa6..00000000000 --- a/src/status_im/contexts/onboarding/identifiers/profile_card/view.cljs +++ /dev/null @@ -1,64 +0,0 @@ -(ns status-im.contexts.onboarding.identifiers.profile-card.view - (:require - [quo.core :as quo] - [quo.foundations.colors :as colors] - [react-native.core :as rn] - [react-native.masked-view :as masked-view] - [react-native.reanimated :as reanimated] - [reagent.core :as reagent] - [status-im.contexts.onboarding.identifiers.profile-card.style :as style] - [utils.worklets.identifiers-highlighting :as worklets.identifiers-highlighting])) - -(defn- f-profile-card-component - [{:keys [profile-picture name emoji-hash - customization-color progress] - :or {customization-color :turquoise} - :as props}] - (let [container-background (worklets.identifiers-highlighting/background - (colors/custom-color customization-color 50) - @progress) - opacity (worklets.identifiers-highlighting/opacity @progress) - avatar-opacity (worklets.identifiers-highlighting/avatar-opacity @progress) - ring-opacity (worklets.identifiers-highlighting/ring-opacity @progress) - user-hash-color (worklets.identifiers-highlighting/user-hash-color @progress) - user-hash-opacity (worklets.identifiers-highlighting/user-hash-opacity @progress) - emoji-hash-style (worklets.identifiers-highlighting/emoji-hash-style @progress) - avatar [quo/user-avatar - {:full-name name - :profile-picture profile-picture - :size :medium - :status-indicator? false - :customization-color customization-color}]] - [rn/view - {:pointer-events :none :style style/card-view} - [reanimated/view - {:style (style/card-container container-background)} - [rn/view {:style style/card-header} - [reanimated/view {:style (style/avatar avatar-opacity)} avatar] - [masked-view/masked-view - {:style {:position :absolute} - :mask-element (reagent/as-element - [reanimated/view {:style (style/mask-view ring-opacity)}])} - (when profile-picture avatar)]] - [reanimated/view - {:style (style/user-name-container opacity)} - [quo/text - {:size :heading-2 - :weight :semi-bold - :number-of-lines 1 - :style style/user-name} name]] - [reanimated/text - {:number-of-lines 3 - :style (style/user-hash user-hash-color user-hash-opacity)} - (:hash props)] - [reanimated/view - {:style [emoji-hash-style]} - [quo/text - {:weight :monospace - :number-of-lines 1 - :style style/emoji-hash} - emoji-hash]]]])) - -(defn profile-card - [props] - [:f> f-profile-card-component props]) diff --git a/src/status_im/contexts/onboarding/identifiers/style.cljs b/src/status_im/contexts/onboarding/identifiers/style.cljs deleted file mode 100644 index 6e58de9d272..00000000000 --- a/src/status_im/contexts/onboarding/identifiers/style.cljs +++ /dev/null @@ -1,22 +0,0 @@ -(ns status-im.contexts.onboarding.identifiers.style) - -(def page-container - {:flex 1 - :overflow :hidden}) - -(def content-container - {:position :absolute - :top 166 - :bottom 0 - :left 0 - :right 0}) - -(def button - {:justify-self :flex-end - :margin-bottom 46 - :margin-horizontal 20}) - -(defn carousel-background - [height width] - {:height height - :width width}) diff --git a/src/status_im/contexts/onboarding/identifiers/view.cljs b/src/status_im/contexts/onboarding/identifiers/view.cljs deleted file mode 100644 index 949c79325d5..00000000000 --- a/src/status_im/contexts/onboarding/identifiers/view.cljs +++ /dev/null @@ -1,73 +0,0 @@ -(ns status-im.contexts.onboarding.identifiers.view - (:require - [clojure.string :as string] - [quo.core :as quo] - [react-native.core :as rn] - [status-im.contexts.onboarding.common.carousel.animation :as carousel.animation] - [status-im.contexts.onboarding.common.carousel.view :as carousel] - [status-im.contexts.onboarding.identifiers.profile-card.view :as profile-card] - [status-im.contexts.onboarding.identifiers.style :as style] - [utils.i18n :as i18n] - [utils.re-frame :as rf])) - -(def header-text - [{:text (i18n/label :t/unique-identifiers) - :sub-text (i18n/label :t/your-identifiers)} - {:text (i18n/label :t/identicon-ring) - :sub-text (i18n/label :t/identicon-ring-explanation)} - {:text (i18n/label :t/chat-key-title) - :sub-text (i18n/label :t/chat-key-description)} - {:text (i18n/label :t/emojihash) - :sub-text (i18n/label :t/emojihash-description)}]) - -(defn- navigate-to-enable-notifications - [] - (rf/dispatch [:onboarding/navigate-to-enable-notifications])) - -(defn f-view - [] - (let [progress (atom nil) - paused? (atom nil) - is-dragging? (atom nil) - drag-amount (atom nil) - window-width (rf/sub [:dimensions/window-width]) - window-height (rf/sub [:dimensions/window-height]) - {:keys [emoji-hash display-name compressed-key - public-key]} (rf/sub [:profile/profile]) - {:keys [color]} (rf/sub [:onboarding/profile]) - photo-path (rf/sub [:chats/photo-path public-key]) - emoji-string (string/join emoji-hash)] - (carousel.animation/use-initialize-animation progress paused? true is-dragging? drag-amount) - (rn/use-mount #(carousel.animation/cleanup-animation progress paused?)) - [:<> - [rn/view {:style style/page-container} - [carousel/view - {:animate? true - :progress progress - :paused? paused? - :gesture :swipeable - :is-dragging? is-dragging? - :drag-amount drag-amount - :header-text header-text - :background [rn/view - {:style (style/carousel-background window-height - (* (count header-text) window-width))}]}] - [rn/view - {:style style/content-container - :pointer-events :box-none} - [profile-card/profile-card - {:profile-picture photo-path - :name display-name - :hash compressed-key - :emoji-hash emoji-string - :customization-color color - :progress progress}] - [quo/button - {:accessibility-label :skip-identifiers - :type :grey - :background :blur - :on-press navigate-to-enable-notifications - :container-style style/button} - (i18n/label :t/continue)]]]])) - -(defn view [props] [:f> f-view props]) diff --git a/src/status_im/contexts/onboarding/intro/view.cljs b/src/status_im/contexts/onboarding/intro/view.cljs index 4bf41c58012..34d2371fd92 100644 --- a/src/status_im/contexts/onboarding/intro/view.cljs +++ b/src/status_im/contexts/onboarding/intro/view.cljs @@ -55,7 +55,7 @@ (rf/dispatch [:onboarding/use-temporary-display-name false]) (rf/dispatch [:open-modal :screen/onboarding.share-usage - {:next-screen :screen/onboarding.sync-or-recover-profile}])) + {:next-screen :screen/onboarding.log-in}])) (defn- create-profile [] @@ -63,7 +63,7 @@ (blur-show-fn)) (rf/dispatch [:onboarding/use-temporary-display-name true]) (rf/dispatch [:open-modal :screen/onboarding.share-usage - {:next-screen :screen/onboarding.new-to-status}])) + {:next-screen :screen/onboarding.create-profile}])) (defn view [] diff --git a/src/status_im/contexts/onboarding/create_or_sync_profile/view.cljs b/src/status_im/contexts/onboarding/log_in/view.cljs similarity index 51% rename from src/status_im/contexts/onboarding/create_or_sync_profile/view.cljs rename to src/status_im/contexts/onboarding/log_in/view.cljs index 800295191e7..842185ed286 100644 --- a/src/status_im/contexts/onboarding/create_or_sync_profile/view.cljs +++ b/src/status_im/contexts/onboarding/log_in/view.cljs @@ -1,4 +1,4 @@ -(ns status-im.contexts.onboarding.create-or-sync-profile.view +(ns status-im.contexts.onboarding.log-in.view (:require [quo.core :as quo] re-frame.db @@ -8,18 +8,12 @@ [status-im.common.events-helper :as events-helper] [status-im.common.resources :as resources] [status-im.config :as config] - [status-im.contexts.onboarding.create-or-sync-profile.style :as style] + [status-im.contexts.onboarding.create-profile.style :as style] [status-im.contexts.onboarding.getting-started-doc.view :as getting-started-doc] [utils.debounce :as debounce] [utils.i18n :as i18n] [utils.re-frame :as rf])) -(defn- navigate-to-create-profile - [] - (debounce/throttle-and-dispatch - [:onboarding/navigate-to-create-profile] - 1000)) - (defn- navigate-to-sign-in-by-syncing [] (rf/dispatch [:syncing/clear-syncing-fallback-flow]) @@ -36,12 +30,9 @@ :shell? true}])) (defn- navigate-to-sign-in-by-recovery-phrase - [create-profile?] + [] (rf/dispatch [:syncing/clear-syncing-fallback-flow]) - (rf/dispatch [:onboarding/navigate-to-sign-in-by-seed-phrase - (if create-profile? - :screen/onboarding.new-to-status - :screen/onboarding.sync-or-recover-profile)])) + (rf/dispatch [:onboarding/navigate-to-sign-in-by-seed-phrase :screen/onboarding.log-in])) (defn- option-card-max-height [window-height] @@ -50,18 +41,6 @@ (* 2 16) ;; spacing between items 220)) ;; extra spacing (top bar) -(defn- start-fresh-main-card - [window-height] - [quo/small-option-card - {:variant :main - :title (i18n/label :t/start-fresh) - :subtitle (i18n/label :t/start-fresh-subtitle) - :button-label (i18n/label :t/lets-go) - :accessibility-label :start-fresh-main-card - :image (resources/get-image :generate-keys) - :max-height (option-card-max-height window-height) - :on-press navigate-to-create-profile}]) - (defn- log-in-with-recovery-phrase-main-card [window-height] [quo/small-option-card @@ -72,17 +51,7 @@ :accessibility-label :log-in-with-recovery-phrase-main-card :image (resources/get-image :use-recovery-phrase) :max-height (option-card-max-height window-height) - :on-press #(navigate-to-sign-in-by-recovery-phrase false)}]) - -(defn- use-recovery-phrase-icon-card - [] - [quo/small-option-card - {:variant :icon - :title (i18n/label :t/use-a-recovery-phrase) - :subtitle (i18n/label :t/use-a-recovery-phrase-subtitle) - :accessibility-label :use-a-recovery-phrase-icon-card - :image (resources/get-image :ethereum-address) - :on-press #(navigate-to-sign-in-by-recovery-phrase true)}]) + :on-press navigate-to-sign-in-by-recovery-phrase}]) (defn- log-in-by-syncing-icon-card [] @@ -94,16 +63,6 @@ :image (resources/get-image :login-syncing) :on-press show-check-before-syncing}]) -(defn- use-empty-keycard-icon-card - [] - [quo/small-option-card - {:variant :icon - :title (i18n/label :t/use-an-empty-keycard) - :subtitle (i18n/label :t/use-an-empty-keycard-subtitle) - :accessibility-label :use-an-empty-keycard-icon-card - :image (resources/get-image :use-keycard) - :on-press #(rf/dispatch [:open-modal :screen/keycard.create-profile])}]) - (defn- log-in-with-keycard-icon-card [] [quo/small-option-card @@ -116,39 +75,14 @@ (rf/dispatch [:open-modal :screen/keycard.check {:on-press #(rf/dispatch [:keycard.login/check-card])}]))}]) -(defn sign-in-options - [create-profile?] - (let [window-height (rf/sub [:dimensions/window-height])] - [rn/view {:style style/options-container} - [quo/text - {:style style/title - :size :heading-1 - :weight :semi-bold} - (i18n/label (if create-profile? :t/create-profile :t/log-in))] - (if create-profile? - [start-fresh-main-card window-height] - [log-in-with-recovery-phrase-main-card window-height]) - [rn/view {:style style/subtitle-container} - [quo/text - {:style style/subtitle - :size :paragraph-2 - :weight :medium} - (i18n/label :t/other-options)]] - (if create-profile? - [use-recovery-phrase-icon-card] - [log-in-by-syncing-icon-card]) - [rn/view {:style style/space-between-suboptions}] - (if create-profile? - [use-empty-keycard-icon-card] - [log-in-with-keycard-icon-card])])) - (defn- navigate-to-quo-preview [] (rf/dispatch [:navigate-to :quo-preview])) -(defn- internal-view - [sign-in-type] - (let [{:keys [top]} (safe-area/get-insets)] +(defn view + [] + (let [{:keys [top]} (safe-area/get-insets) + window-height (rf/sub [:dimensions/window-height])] [rn/view {:style style/content-container} [quo/page-nav {:margin-top top @@ -161,12 +95,19 @@ (when config/quo-preview-enabled? {:icon-name :i/reveal-whitelist :on-press navigate-to-quo-preview})]}] - [sign-in-options (= sign-in-type :create-profile)]])) - -(defn create-profile - [] - [internal-view :create-profile]) - -(defn sync-or-recover-profile - [] - [internal-view :sync-or-recover-profile]) + [rn/view {:style style/options-container} + [quo/text + {:style style/title + :size :heading-1 + :weight :semi-bold} + (i18n/label :t/log-in)] + [log-in-with-recovery-phrase-main-card window-height] + [rn/view {:style style/subtitle-container} + [quo/text + {:style style/subtitle + :size :paragraph-2 + :weight :medium} + (i18n/label :t/other-options)]] + [log-in-by-syncing-icon-card] + [rn/view {:style style/space-between-suboptions}] + [log-in-with-keycard-icon-card]]])) diff --git a/src/status_im/contexts/onboarding/syncing/progress/view.cljs b/src/status_im/contexts/onboarding/syncing/progress/view.cljs index 08aa1256a03..ad5766ec108 100644 --- a/src/status_im/contexts/onboarding/syncing/progress/view.cljs +++ b/src/status_im/contexts/onboarding/syncing/progress/view.cljs @@ -30,7 +30,7 @@ [] (rf/dispatch [:syncing/set-syncing-fallback-flow]) (debounce/debounce-and-dispatch - [:onboarding/navigate-to-sign-in-by-seed-phrase :screen/onboarding.sync-or-recover-profile] + [:onboarding/navigate-to-sign-in-by-seed-phrase :screen/onboarding.log-in] 500)) (defn- try-again @@ -38,7 +38,7 @@ (rf/dispatch [:syncing/clear-states]) (if logged-in? (rf/dispatch [:navigate-back]) - (rf/dispatch [:navigate-back-to :screen/onboarding.sync-or-recover-profile]))) + (rf/dispatch [:navigate-back-to :screen/onboarding.log-in]))) (defn try-again-button [profile-color logged-in?] diff --git a/src/status_im/contexts/profile/profiles/view.cljs b/src/status_im/contexts/profile/profiles/view.cljs index ff7ac9252d7..bbdd311e7b8 100644 --- a/src/status_im/contexts/profile/profiles/view.cljs +++ b/src/status_im/contexts/profile/profiles/view.cljs @@ -49,7 +49,7 @@ (@push-animation-fn-atom)) (rf/dispatch [:onboarding/use-temporary-display-name true]) (debounce/throttle-and-dispatch - [:open-modal :screen/onboarding.new-to-status] + [:open-modal :screen/onboarding.create-profile] 1000)) (defn- navigate-to-sync-or-recover-profile @@ -58,7 +58,7 @@ (@push-animation-fn-atom)) (rf/dispatch [:onboarding/use-temporary-display-name false]) (debounce/throttle-and-dispatch - [:open-modal :screen/onboarding.sync-or-recover-profile] + [:open-modal :screen/onboarding.log-in] 1000)) (defn new-account-options diff --git a/src/status_im/navigation/screens.cljs b/src/status_im/navigation/screens.cljs index b039a5d0146..7e6fd15aac8 100644 --- a/src/status_im/navigation/screens.cljs +++ b/src/status_im/navigation/screens.cljs @@ -43,12 +43,12 @@ [status-im.contexts.keycard.not-keycard.view :as keycard.not-keycard] [status-im.contexts.keycard.pin.create.view :as keycard.pin.create] [status-im.contexts.keycard.pin.enter.view :as keycard.pin.enter] - [status-im.contexts.onboarding.create-or-sync-profile.view :as create-or-sync-profile] [status-im.contexts.onboarding.create-password.view :as create-password] + [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-notifications.view :as enable-notifications] - [status-im.contexts.onboarding.identifiers.view :as identifiers] [status-im.contexts.onboarding.intro.view :as intro] + [status-im.contexts.onboarding.log-in.view :as log-in] [status-im.contexts.onboarding.preparing-status.view :as preparing-status] [status-im.contexts.onboarding.share-usage.view :as onboarding.share-usage] [status-im.contexts.onboarding.sign-in.view :as sign-in] @@ -720,8 +720,8 @@ :on-focus [:onboarding/overlay-dismiss] :component intro/view}) -(def onboarding-new-to-status - {:name :screen/onboarding.new-to-status +(def onboarding-create-profile + {:name :screen/onboarding.create-profile :metrics {:track? true :alias-id :onboarding.create-profile-intro} :options {:theme :dark @@ -731,10 +731,10 @@ transitions/push-animations-for-transparent-background) :popGesture false :modalPresentationStyle :overCurrentContext} - :component create-or-sync-profile/create-profile}) + :component create-profile/view}) -(def onboarding-sync-or-recover-profile - {:name :screen/onboarding.sync-or-recover-profile +(def onboarding-log-in + {:name :screen/onboarding.log-in :metrics {:track? true} :options {:theme :dark :layout options/onboarding-transparent-layout @@ -743,7 +743,7 @@ transitions/push-animations-for-transparent-background) :popGesture false :modalPresentationStyle :overCurrentContext} - :component create-or-sync-profile/sync-or-recover-profile}) + :component log-in/view}) (def onboarding-create-profile-password {:name :screen/onboarding.create-profile-password @@ -813,17 +813,6 @@ :popStackOnPress false}} :component enable-notifications/view}) -(def onboarding-identifiers - {:name :screen/onboarding.identifiers - :metrics {:track? true} - :component identifiers/view - :options {:theme :dark - :layout options/onboarding-transparent-layout - :animations transitions/push-animations-for-transparent-background - :popGesture false - :hardwareBackButton {:dismissModalOnPress false - :popStackOnPress false}}}) - (def onboarding-sign-in-intro {:name :screen/onboarding.sign-in-intro :metrics {:track? true @@ -875,14 +864,13 @@ (def onboarding-screens [onboarding-intro - onboarding-new-to-status - onboarding-sync-or-recover-profile + onboarding-create-profile + onboarding-log-in onboarding-create-profile-password onboarding-enable-biometrics onboarding-preparing-status onboarding-entering-seed-phrase onboarding-enable-notifications - onboarding-identifiers onboarding-share-usage onboarding-sign-in-intro onboarding-sign-in From 4eb38c7544e18d7fc15478f8c6523cc3cda580f7 Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Fri, 20 Dec 2024 17:24:24 +0530 Subject: [PATCH 2/2] Review changes --- .../contexts/onboarding/create_profile/view.cljs | 1 - src/status_im/contexts/onboarding/events.cljs | 11 ----------- src/status_im/contexts/onboarding/log_in/view.cljs | 1 - 3 files changed, 13 deletions(-) diff --git a/src/status_im/contexts/onboarding/create_profile/view.cljs b/src/status_im/contexts/onboarding/create_profile/view.cljs index d384e6842b8..413eceb457e 100644 --- a/src/status_im/contexts/onboarding/create_profile/view.cljs +++ b/src/status_im/contexts/onboarding/create_profile/view.cljs @@ -1,7 +1,6 @@ (ns status-im.contexts.onboarding.create-profile.view (:require [quo.core :as quo] - re-frame.db [react-native.core :as rn] [react-native.safe-area :as safe-area] [status-im.common.events-helper :as events-helper] diff --git a/src/status_im/contexts/onboarding/events.cljs b/src/status_im/contexts/onboarding/events.cljs index 0ba2c4ea292..3bce2325b34 100644 --- a/src/status_im/contexts/onboarding/events.cljs +++ b/src/status_im/contexts/onboarding/events.cljs @@ -20,17 +20,6 @@ [:dispatch [:profile/show-testnet-mode-banner-if-enabled]] [:dispatch [:universal-links/process-stored-event]]]})) -(rf/reg-event-fx - :onboarding/profile-data-set - (fn [{:keys [db]} [onboarding-data]] - (let [navigate-from-screen (get db - :onboarding/navigated-to-enter-seed-phrase-from-screen - :screen/onboarding.create-profile)] - {:db (update db :onboarding/profile merge onboarding-data) - :fx [[:dispatch - [:navigate-to-within-stack - [:screen/onboarding.create-profile-password navigate-from-screen]]]]}))) - (rf/defn enable-biometrics {:events [:onboarding/enable-biometrics]} [_] diff --git a/src/status_im/contexts/onboarding/log_in/view.cljs b/src/status_im/contexts/onboarding/log_in/view.cljs index 842185ed286..2ac2941e700 100644 --- a/src/status_im/contexts/onboarding/log_in/view.cljs +++ b/src/status_im/contexts/onboarding/log_in/view.cljs @@ -1,7 +1,6 @@ (ns status-im.contexts.onboarding.log-in.view (:require [quo.core :as quo] - re-frame.db [react-native.core :as rn] [react-native.safe-area :as safe-area] [status-im.common.check-before-syncing.view :as check-before-syncing]