fix(SW-360): set default validate behaviour to onBlur on signup page

This commit is contained in:
Chuma McPhoy
2024-11-20 17:54:57 +01:00
parent 70000afe1f
commit 0865a553cd
6 changed files with 9 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ export default function SignupForm({ link, subtitle, title }: SignUpFormProps) {
const email = intl.formatMessage({ id: "Email address" })
const phoneNumber = intl.formatMessage({ id: "Phone number" })
const zipCode = intl.formatMessage({ id: "Zip code" })
const acceptTermsText = intl.formatMessage({ id: "signupPage.terms" })
const signupButtonText = intl.formatMessage({
id: "Sign up to Scandic Friends",
})
@@ -66,8 +67,9 @@ export default function SignupForm({ link, subtitle, title }: SignUpFormProps) {
zipCode: "",
},
password: "",
termsAccepted: false,
},
mode: "all",
mode: "onBlur",
criteriaMode: "all",
resolver: zodResolver(signUpSchema),
reValidateMode: "onChange",
@@ -157,9 +159,7 @@ export default function SignupForm({ link, subtitle, title }: SignUpFormProps) {
</header>
<Checkbox name="termsAccepted" registerOptions={{ required: true }}>
<Body>
{intl.formatMessage({
id: "Yes, I accept the Terms and conditions for Scandic Friends and understand that Scandic will process my personal data in accordance with",
})}{" "}
{acceptTermsText}{" "}
<Link
variant="underscored"
color="peach80"