From 45b501816a4a48c4a888e9a7f88925a8a18784b8 Mon Sep 17 00:00:00 2001 From: R Adithya Kumar <73246484+SilentCruzer@users.noreply.github.com> Date: Mon, 17 Apr 2023 17:19:32 +0530 Subject: [PATCH] [#15518]Show disclaimer during password creation (#15650) --- .../onboarding/create_password/view.cljs | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/status_im2/contexts/onboarding/create_password/view.cljs b/src/status_im2/contexts/onboarding/create_password/view.cljs index d42a794ae8..36ef2db088 100644 --- a/src/status_im2/contexts/onboarding/create_password/view.cljs +++ b/src/status_im2/contexts/onboarding/create_password/view.cljs @@ -65,7 +65,7 @@ :shown true} :placeholder (i18n/label :t/password-creation-placeholder-1) :on-change-text on-change-password - :on-focus #(on-input-focus :password)}] + :on-focus on-input-focus}] [rn/view {:style style/space-between-inputs}] [password-with-hint {:hint {:text hint-2-text @@ -75,7 +75,7 @@ :error? error? :placeholder (i18n/label :t/password-creation-placeholder-2) :on-change-text on-change-repeat-password - :on-focus #(on-input-focus :repeat-password) + :on-focus on-input-focus :on-blur on-blur-repeat-password}]])) (def strength-status @@ -146,9 +146,9 @@ :passwords-match? same-passwords? :empty-password? empty-password? :show-password-validation? @show-password-validation? - :on-input-focus (fn [input-id] + :on-input-focus (fn [] (scroll-to-end-fn) - (reset! focused-input input-id)) + (reset! focused-input :password)) :on-change-password (fn [new-value] (reset! password new-value) (when (same-password-length?) @@ -162,19 +162,17 @@ (reset! show-password-validation? true))}]] [rn/view {:style style/bottom-part} + [rn/view {:style style/disclaimer-container} + [quo/disclaimer + {:on-change #(reset! accepts-disclaimer? %) + :checked? @accepts-disclaimer?} + (i18n/label :t/password-creation-disclaimer)]] + (when (= @focused-input :password) [help {:validations validations :password-strength password-strength}]) - (when (= @focused-input :repeat-password) - [rn/view {:style style/disclaimer-container} - [quo/disclaimer - {:blur? true - :checked? @accepts-disclaimer? - :on-change #(reset! accepts-disclaimer? %)} - (i18n/label :t/password-creation-disclaimer)]]) - [rn/view {:style style/button-container} [quo/button {:disabled (not meet-requirements?)