-
Notifications
You must be signed in to change notification settings - Fork 985
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
Onboarding remove identifiers code and refactor create_or_sync_profile screen #21668
base: develop
Are you sure you want to change the base?
Changes from all 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 |
---|---|---|
@@ -0,0 +1,100 @@ | ||
(ns status-im.contexts.onboarding.create-profile.view | ||
(:require | ||
[quo.core :as quo] | ||
[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 | ||
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. don we have this in every control ? 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. Thank you, @flexsurfer, for reviewing the PR. Are you asking if we need the create-profile-password in both the create-profile and login flows? Yes, we do. For the create profile flow, we are directly navigating to the create-profile-password screen here. However, for the login flow, navigation to the password screen occurs after the seed phrase is validated. |
||
[] | ||
(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]]])) |
This file was deleted.
This file was deleted.
This file was deleted.
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.
Refactored the create-or-sync-profile screen and split it into two separate screens:
('Create Profile' and 'Log In - as per figma)