From 7908779c89f420039b8cc3a1b1daa9d159a640ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C4=B1dvan=20Akca?= Date: Tue, 7 Mar 2023 15:25:40 +0300 Subject: [PATCH] fix: add custom email error message for signup --- packages/web/src/components/SignUpForm/index.ee.tsx | 6 +++++- packages/web/src/locales/en.json | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/web/src/components/SignUpForm/index.ee.tsx b/packages/web/src/components/SignUpForm/index.ee.tsx index 9c14c5e5..71070fcf 100644 --- a/packages/web/src/components/SignUpForm/index.ee.tsx +++ b/packages/web/src/components/SignUpForm/index.ee.tsx @@ -17,7 +17,11 @@ import useFormatMessage from 'hooks/useFormatMessage'; const validationSchema = yup.object().shape({ fullName: yup.string().trim().required('signupForm.mandatoryInput'), - email: yup.string().trim().email().required('signupForm.mandatoryInput'), + email: yup + .string() + .trim() + .email('signupForm.validateEmail') + .required('signupForm.mandatoryInput'), password: yup.string().required('signupForm.mandatoryInput'), confirmPassword: yup .string() diff --git a/packages/web/src/locales/en.json b/packages/web/src/locales/en.json index 2612facf..ddfda549 100644 --- a/packages/web/src/locales/en.json +++ b/packages/web/src/locales/en.json @@ -116,6 +116,7 @@ "signupForm.passwordFieldLabel": "Password", "signupForm.confirmPasswordFieldLabel": "Confirm password", "signupForm.submit": "Sign up", + "signupForm.validateEmail": "Email must be valid.", "signupForm.passwordsMustMatch": "Passwords must match.", "signupForm.mandatoryInput": "{inputName} is required.", "loginForm.title": "Login", @@ -136,4 +137,4 @@ "resetPasswordForm.passwordFieldLabel": "Password", "resetPasswordForm.confirmPasswordFieldLabel": "Confirm password", "resetPasswordForm.passwordUpdated": "The password has been updated. Now, you can login." -} \ No newline at end of file +}