ФК кнопка отправки заблокирована пока не введут почту
This commit is contained in:
parent
b495974dba
commit
656ba9473c
@ -200,6 +200,9 @@ export const ContactForm = ({ currentQuestion, onShowResult }: Props) => {
|
||||
const minDigits = isRussianNumber ? 11 : 10;
|
||||
const isPhoneValid = phone.trim().length === 0 || digitsOnly.length >= minDigits;
|
||||
|
||||
// Проверяем валидность email - не должен быть пустым
|
||||
const isEmailValid = email.trim().length === 0;
|
||||
|
||||
// Обработчик изменения телефона
|
||||
const handlePhoneChange = (newPhone: string) => {
|
||||
setPhone(newPhone);
|
||||
@ -332,7 +335,7 @@ export const ContactForm = ({ currentQuestion, onShowResult }: Props) => {
|
||||
</Box>
|
||||
|
||||
<Button
|
||||
disabled={!(ready && !fire && isPhoneValid)}
|
||||
disabled={!(ready && !fire && isPhoneValid && isEmailValid)}
|
||||
variant="contained"
|
||||
onClick={handleShowResultsClick}
|
||||
sx={{
|
||||
|
Loading…
Reference in New Issue
Block a user