File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/status_im/contexts/onboarding/create_password Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 2727 (i18n/label :t/password-creation-subtitle )]])
2828
2929(defn password-inputs
30- [{:keys [set-password set-repeat-password same-password-length? same-passwords?
30+ [{:keys [set-password set-repeat-password same-passwords? password repeat-password
3131 password-long-enough? password-short-enough?]}]
3232 (let [hint-1-status (if password-long-enough? :success :default )
3333 hint-2-status (if same-passwords? :success :error )
3737 [error? set-error] (rn/use-state false )]
3838 (rn/use-effect
3939 (fn []
40- (when (and (not error?) same-password-length? (not same-passwords?))
41- (set-error true )))
42- [error? same-password-length? same-passwords?])
40+ (set-error (and (>= (count repeat-password) (count password))
41+ password-long-enough?
42+ (not same-passwords?)))
43+ [password repeat-password same-passwords?]))
4344 [:<>
4445 [password-with-hint/view
4546 {:hint (if (not password-short-enough?)
5758 {:hint {:text hint-2-text
5859 :status hint-2-status
5960 :shown? (or same-passwords? error?)}
60- :error? ( and error? ( not same-passwords?))
61+ :error? error?
6162 :placeholder (i18n/label :t/password-creation-placeholder-2 )
6263 :on-change-text set-repeat-password}]]))
6364
174175 {:password-long-enough? long-enough?
175176 :password-short-enough? short-enough?
176177 :non-empty-password? non-empty?
178+ :password password
179+ :repeat-password repeat-password
177180 :same-passwords? same-passwords?
178181 :same-password-length? same-password-length?
179182 :set-password set-password
You can’t perform that action at this time.
0 commit comments