вроде доделана валидация формы с сообщениями ошибок
This commit is contained in:
@@ -64,7 +64,6 @@ export const Form:React.FC<TProps> = React.memo((props) => {
|
||||
return
|
||||
}
|
||||
if(!EMAIL_REGEXP.test(data.email)) {
|
||||
console.log('dfdffd')
|
||||
return
|
||||
}
|
||||
// console.log(data)
|
||||
@@ -127,11 +126,11 @@ export const Form:React.FC<TProps> = React.memo((props) => {
|
||||
size="medium"
|
||||
label='E-mail'
|
||||
autoComplete="off"
|
||||
error={(isError && field.value === '') || (isError && EMAIL_REGEXP.test(field.value))}
|
||||
error={(isError && field.value === '') || (isError && !EMAIL_REGEXP.test(field.value))}
|
||||
helperText={
|
||||
isError && field.value === ''
|
||||
? LangDict.formEmptyError[lang]
|
||||
: isError && EMAIL_REGEXP.test(field.value)
|
||||
: isError && !EMAIL_REGEXP.test(field.value)
|
||||
? LangDict.formErrorEmail[lang]
|
||||
: null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user