костыльно выключена почта. Костыльно выключена на неё проверка
This commit is contained in:
parent
1c909863ae
commit
af79d4dae3
@ -30,6 +30,10 @@ type Props = {
|
||||
currentQuestion: AnyTypedQuizQuestion;
|
||||
onShowResult: () => void;
|
||||
};
|
||||
//Костыль для особого квиза. Для него не нужно показывать email адрес
|
||||
const isDisableEmail = window.location.pathname.includes("/377c7570-1bee-4320-ac1e-d731b6223ce8");
|
||||
console.log("isDisableEmail");
|
||||
console.log(isDisableEmail);
|
||||
|
||||
export const ContactForm = ({ currentQuestion, onShowResult }: Props) => {
|
||||
const theme = useTheme();
|
||||
@ -115,7 +119,10 @@ export const ContactForm = ({ currentQuestion, onShowResult }: Props) => {
|
||||
|
||||
async function handleShowResultsClick() {
|
||||
const FC = settings.cfg.formContact.fields;
|
||||
if (FC["email"].used !== EMAIL_REGEXP.test(email)) {
|
||||
|
||||
console.log("некорректная");
|
||||
console.log(!isDisableEmail && FC["email"].used !== EMAIL_REGEXP.test(email));
|
||||
if (!isDisableEmail && FC["email"].used !== EMAIL_REGEXP.test(email)) {
|
||||
return enqueueSnackbar("введена некорректная почта");
|
||||
}
|
||||
|
||||
@ -251,6 +258,9 @@ export const ContactForm = ({ currentQuestion, onShowResult }: Props) => {
|
||||
setText={setText}
|
||||
adress={adress}
|
||||
setAdress={setAdress}
|
||||
crutch={{
|
||||
disableEmail: isDisableEmail,
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
<Box
|
||||
|
@ -19,6 +19,9 @@ type InputsProps = {
|
||||
setText: Dispatch<SetStateAction<string>>;
|
||||
adress: string;
|
||||
setAdress: Dispatch<SetStateAction<string>>;
|
||||
crutch: {
|
||||
disableEmail: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
export const Inputs = ({
|
||||
@ -32,10 +35,14 @@ export const Inputs = ({
|
||||
setText,
|
||||
adress,
|
||||
setAdress,
|
||||
crutch,
|
||||
}: InputsProps) => {
|
||||
const { settings } = useQuizSettings();
|
||||
const FC = settings.cfg.formContact.fields;
|
||||
|
||||
console.log("crutch.disableEmail");
|
||||
console.log(crutch.disableEmail);
|
||||
|
||||
if (!FC) return null;
|
||||
const Name = (
|
||||
<CustomInput
|
||||
@ -95,7 +102,7 @@ export const Inputs = ({
|
||||
return (
|
||||
<>
|
||||
{FC["name"].used ? Name : <></>}
|
||||
{FC["email"].used ? Email : <></>}
|
||||
{FC["email"].used && !crutch.disableEmail ? Email : <></>}
|
||||
{FC["phone"].used ? Phone : <></>}
|
||||
{FC["text"].used ? Text : <></>}
|
||||
{FC["address"].used ? Adress : <></>}
|
||||
|
Loading…
Reference in New Issue
Block a user