-
Notifications
You must be signed in to change notification settings - Fork 986
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardized in-app authentication (#16916)
* chore: move password input to connected component --------- Co-authored-by: Jamie Caprani <jamiecaprani@gmail.com> Co-authored-by: frank <lovefree103@gmail.com>
- Loading branch information
Showing
23 changed files
with
452 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/status_im2/common/standard_authentication/enter_password/style.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(ns status-im2.common.standard-authentication.enter-password.style) | ||
|
||
(def enter-password-container | ||
{:margin-horizontal 20 | ||
:border-top-left-radius 12 | ||
:border-top-right-radius 12}) | ||
|
||
(def error-message | ||
{:margin-top 8 | ||
:flex-direction :row | ||
:align-items :center}) | ||
|
||
(def enter-password-button | ||
{:margin-top 45 | ||
:margin-bottom 12}) | ||
|
||
(def context-tag | ||
{:flex-direction :row | ||
:margin-bottom 20 | ||
:margin-top 8}) |
53 changes: 53 additions & 0 deletions
53
src/status_im2/common/standard_authentication/enter_password/view.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
(ns status-im2.common.standard-authentication.enter-password.view | ||
(:require [utils.i18n :as i18n] | ||
[quo2.core :as quo] | ||
[react-native.core :as rn] | ||
[utils.re-frame :as rf] | ||
[status-im2.common.standard-authentication.enter-password.style :as style] | ||
[status-im2.common.standard-authentication.password-input.view :as password-input] | ||
[status-im.multiaccounts.core :as multiaccounts])) | ||
|
||
(defn view | ||
[{:keys [on-enter-password button-label]}] | ||
(let [{:keys [key-uid display-name | ||
customization-color] | ||
:as account} (rf/sub [:profile/multiaccount]) | ||
{:keys [error processing password]} (rf/sub [:profile/login]) | ||
sign-in-enabled? (rf/sub [:sign-in-enabled?]) | ||
profile-picture (multiaccounts/displayed-photo account)] | ||
[:<> | ||
[rn/view {:style style/enter-password-container} | ||
[rn/view | ||
[quo/text | ||
{:accessibility-label :sync-code-generated | ||
:weight :bold | ||
:size :heading-1 | ||
:style {:margin-bottom 4}} | ||
(i18n/label :t/enter-password)] | ||
[rn/view | ||
{:style style/context-tag} | ||
[quo/context-tag | ||
{:type :default | ||
:blur? true | ||
:profile-picture profile-picture | ||
:full-name display-name | ||
:customization-color customization-color | ||
:size 24}]] | ||
[password-input/view | ||
{:processing processing | ||
:error error | ||
:default-password password | ||
:sign-in-enabled? sign-in-enabled?}] | ||
[rn/view {:style style/enter-password-button} | ||
[quo/button | ||
{:size 40 | ||
:type :primary | ||
:customization-color (or customization-color :primary) | ||
:accessibility-label :login-button | ||
:icon-left :i/reveal | ||
:disabled? (or (not sign-in-enabled?) processing) | ||
:on-press (fn [] | ||
(rf/dispatch [:set-in [:profile/login :key-uid] key-uid]) | ||
(rf/dispatch [:profile.login/verify-database-password password | ||
#(on-enter-password password)]))} | ||
button-label]]]]])) |
6 changes: 6 additions & 0 deletions
6
src/status_im2/common/standard_authentication/forgot_password_doc/style.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
(ns status-im2.common.standard-authentication.forgot-password-doc.style) | ||
|
||
(def container {:margin-right 16}) | ||
(def step-container {:flex-direction :row :margin-top 14}) | ||
(def step-content {:margin-left 10}) | ||
(def step-title {:flex-direction :row}) |
52 changes: 52 additions & 0 deletions
52
src/status_im2/common/standard_authentication/forgot_password_doc/view.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
(ns status-im2.common.standard-authentication.forgot-password-doc.view | ||
(:require [status-im2.common.standard-authentication.forgot-password-doc.style :as style] | ||
[quo2.core :as quo] | ||
[react-native.core :as rn] | ||
[utils.i18n :as i18n])) | ||
|
||
(defn view | ||
[{:keys [shell?]}] | ||
[quo/documentation-drawers | ||
{:title (i18n/label :t/forgot-your-password-info-title) | ||
:shell? shell?} | ||
[rn/view | ||
{:style style/container} | ||
[quo/text {:size :paragraph-2} (i18n/label :t/forgot-your-password-info-description)] | ||
|
||
[rn/view {:style style/step-container} | ||
[quo/step {:in-blur-view? shell?} 1] | ||
[rn/view | ||
{:style style/step-content} | ||
[quo/text {:size :paragraph-2 :weight :semi-bold} | ||
(i18n/label :t/forgot-your-password-info-remove-app)] | ||
[quo/text {:size :paragraph-2} (i18n/label :t/forgot-your-password-info-remove-app-description)]]] | ||
|
||
[rn/view {:style style/step-container} | ||
[quo/step {:in-blur-view? shell?} 2] | ||
[rn/view | ||
{:style style/step-content} | ||
[quo/text {:size :paragraph-2 :weight :semi-bold} | ||
(i18n/label :t/forgot-your-password-info-reinstall-app)] | ||
[quo/text {:size :paragraph-2} | ||
(i18n/label :t/forgot-your-password-info-reinstall-app-description)]]] | ||
|
||
[rn/view {:style style/step-container} | ||
[quo/step {:in-blur-view? shell?} 3] | ||
[rn/view | ||
{:style style/step-content} | ||
[rn/view | ||
{:style style/step-title} | ||
[quo/text {:size :paragraph-2} (str (i18n/label :t/sign-up) " ")] | ||
[quo/text {:size :paragraph-2 :weight :semi-bold} | ||
(i18n/label :t/forgot-your-password-info-signup-with-key)]] | ||
[quo/text {:size :paragraph-2} | ||
(i18n/label :t/forgot-your-password-info-signup-with-key-description)]]] | ||
|
||
[rn/view {:style style/step-container} | ||
[quo/step {:in-blur-view? shell?} 4] | ||
[rn/view | ||
{:style style/step-content} | ||
[quo/text {:size :paragraph-2 :weight :semi-bold} | ||
(i18n/label :t/forgot-your-password-info-create-new-password)] | ||
[quo/text {:size :paragraph-2} | ||
(i18n/label :t/forgot-your-password-info-create-new-password-description)]]]]]) |
6 changes: 6 additions & 0 deletions
6
src/status_im2/common/standard_authentication/password_input/style.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
(ns status-im2.common.standard-authentication.password-input.style) | ||
|
||
(def error-message | ||
{:margin-top 8 | ||
:flex-direction :row | ||
:align-items :center}) |
Oops, something went wrong.