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