mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-21 09:09:09 -05:00
improve email validation error handling with partial string matching
This commit is contained in:
@@ -68,7 +68,11 @@ function StepTwo({ form, errors, onSubmit, onChange, onBack }) {
|
||||
onInput={(e) => (e.target.value = e.target.value.toLowerCase())}
|
||||
onChange={onChange}
|
||||
error={errors.email ? true : false}
|
||||
helperText={errors.email && (errors.email === "Email is required" ? t("authRegisterEmailRequired") : errors.email === "Must be a valid email address" ? t("authRegisterEmailInvalid") : errors.email)}
|
||||
helperText={errors.email && (
|
||||
errors.email.includes("required") ? t("authRegisterEmailRequired") :
|
||||
errors.email.includes("valid email") ? t("authRegisterEmailInvalid") :
|
||||
errors.email
|
||||
)}
|
||||
ref={inputRef}
|
||||
/>
|
||||
<Stack
|
||||
|
||||
Reference in New Issue
Block a user