From 89644bc0c46efbc2801e7945a0fe68d0a70e4cab Mon Sep 17 00:00:00 2001 From: Christiaan Scheermeijer Date: Wed, 4 Aug 2021 14:24:34 +0200 Subject: [PATCH] fix(auth): validate registration form on blur and improve password strength --- .../EditPasswordForm.test.tsx.snap | 9 ++-- .../PasswordStrength.module.scss | 48 +++++++++++-------- .../PasswordStrength/PasswordStrength.tsx | 33 +++++++++---- .../PasswordStrength.test.tsx.snap | 9 ++-- .../RegistrationForm/RegistrationForm.tsx | 12 ++++- .../RegistrationForm.test.tsx.snap | 28 +++++++---- src/components/TextField/TextField.tsx | 3 +- .../AccountModal/forms/Registration.tsx | 5 +- src/hooks/useForm.ts | 41 ++++++++++++++-- src/i18n/locales/en_US/account.json | 11 ++++- src/i18n/locales/nl_NL/account.json | 9 +++- types/form.d.ts | 1 + 12 files changed, 153 insertions(+), 56 deletions(-) diff --git a/src/components/EditPasswordForm/__snapshots__/EditPasswordForm.test.tsx.snap b/src/components/EditPasswordForm/__snapshots__/EditPasswordForm.test.tsx.snap index c397a5202..4bbaa1876 100644 --- a/src/components/EditPasswordForm/__snapshots__/EditPasswordForm.test.tsx.snap +++ b/src/components/EditPasswordForm/__snapshots__/EditPasswordForm.test.tsx.snap @@ -60,17 +60,20 @@ exports[` renders and matches snapshot 1`] = `
- - registration.password_strength + + + registration.password_strength.invalid
- -
+ > +
+
+
+ + + registration.password_strength.invalid + +
+ registration.password_helper_text
- - registration.password_strength -