diff --git a/src/pages/ContactFormPage/ContactFormPage.tsx b/src/pages/ContactFormPage/ContactFormPage.tsx index 382bd023..f7ff4176 100644 --- a/src/pages/ContactFormPage/ContactFormPage.tsx +++ b/src/pages/ContactFormPage/ContactFormPage.tsx @@ -27,7 +27,7 @@ const buttons = [ }, { name: "Email", - desc: "mail@xample.ru", + desc: "mail@example.ru", key: "email" }, { @@ -297,7 +297,7 @@ const ButtonsCard = ({ drawerNewFieldHC }: any) => { Добавить поле + } - drawerMessengerHC(true)} sx={{ @@ -309,7 +309,7 @@ const ButtonsCard = ({ drawerNewFieldHC }: any) => { }} > Добавить мессенджеры - + */} @@ -355,7 +355,7 @@ const EmptyCard = ({ drawerNewFieldHC }: { drawerNewFieldHC: (a: string) => void - void }} > Добавить мессенджеры - + */} ) diff --git a/src/pages/ResultPage/cards/ResultCard.tsx b/src/pages/ResultPage/cards/ResultCard.tsx index bd6702cd..c180a376 100644 --- a/src/pages/ResultPage/cards/ResultCard.tsx +++ b/src/pages/ResultPage/cards/ResultCard.tsx @@ -458,7 +458,7 @@ export const ResultCard = ({ resultContract, resultData }: Props) => { placeholder="URL видео" text={resultData.content.video ?? ""} onChange={e => updateQuestion(resultData.id, q => { - resultData.content.video = e.target.value; + q.content.video = e.target.value; })} /> diff --git a/src/pages/ViewPublicationPage/ContactForm.tsx b/src/pages/ViewPublicationPage/ContactForm.tsx index 5bd41ebf..9707c4dd 100644 --- a/src/pages/ViewPublicationPage/ContactForm.tsx +++ b/src/pages/ViewPublicationPage/ContactForm.tsx @@ -1,6 +1,13 @@ -import { Box, Typography, Button } from "@mui/material"; +import { Box, Typography, Button, Paper, TextField, Link, FormControl } from "@mui/material"; +import NameIcon from "@icons/ContactFormIcon/NameIcon"; +import EmailIcon from "@icons/ContactFormIcon/EmailIcon"; +import PhoneIcon from "@icons/ContactFormIcon/PhoneIcon"; +import TextIcon from "@icons/ContactFormIcon/TextIcon"; +import AddressIcon from "@icons/ContactFormIcon/AddressIcon"; import { useCurrentQuiz } from "@root/quizes/hooks"; +import CustomCheckbox from "@ui_kit/CustomCheckbox"; +import { useState } from "react"; type ContactFormProps = { showResultForm: boolean; @@ -8,6 +15,14 @@ type ContactFormProps = { setShowResultForm: (show: boolean) => void; }; +const icons = [ + { type: "name", icon: NameIcon, defaultText: "Введите имя", defaultTitle: "имя" }, + { type: "email", icon: EmailIcon, defaultText: "Введите Email", defaultTitle: "Email" }, + { type: "phone", icon: PhoneIcon, defaultText: "Введите номер телефона", defaultTitle: "номер телефона" }, + { type: "text", icon: TextIcon, defaultText: "Введите фамилию", defaultTitle: "фамилию" }, + { type: "address", icon: AddressIcon, defaultText: "Введите адрес", defaultTitle: "адрес" }, +] + export const ContactForm = ({ showResultForm, setShowContactForm, @@ -15,19 +30,109 @@ export const ContactForm = ({ }: ContactFormProps) => { const quiz = useCurrentQuiz(); + const [ready, setReady] = useState(false) const followNextForm = () => { setShowContactForm(false); setShowResultForm(true); }; return ( - - Форма контактов - {!showResultForm && quiz?.config.resultInfo.when === "after" && ( - - )} + + + + + + Заполните форму, чтобы получить результаты теста + + + + + + + + { + icons.map((data) => { + const FC = quiz?.config.formContact[data.type] + return FC.used ? + : + <> + }) + } + + + + {!showResultForm && quiz?.config.resultInfo.when === "after" && ( + + )} + + + {setReady(target.checked)}} checked={ready} /> + + С + Положением об обработке персональных данных + и + Политикой конфиденциальности + ознакомлен + + + + + ); }; + +const CustomInput = ({ title, desc, Icon }: any) => { + return + {title} + , + }} + /> + +} \ No newline at end of file diff --git a/src/pages/ViewPublicationPage/Question.tsx b/src/pages/ViewPublicationPage/Question.tsx index 9dd17654..54789d3e 100644 --- a/src/pages/ViewPublicationPage/Question.tsx +++ b/src/pages/ViewPublicationPage/Question.tsx @@ -68,17 +68,20 @@ export const Question = ({ questions }: QuestionProps) => { return ( - + {!showContactForm && !showResultForm && !resultQuestion && ( - + + + + )} {resultQuestion && ( { )} {showResultForm && ( void; setShowResultForm: (show: boolean) => void; }; export const ResultForm = ({ + resultQuestion, showContactForm, setShowContactForm, setShowResultForm, + }: ResultFormProps) => { const quiz = useCurrentQuiz(); + const myresult = useQuestionsStore().questions.filter((q) => q.type === "result")[0] + console.log("ResultForm") + console.log(myresult) const followNextForm = () => { setShowResultForm(false); setShowContactForm(true); }; + console.log("quiz", quiz) + console.log("quiz?.config.useImage", myresult?.content.useImage) return ( - - Форма результатов + + + + { + !myresult?.content.useImage && + myresult.content.video && + + } + { + myresult?.content.useImage && + myresult.content.back && + + + } + + {myresult.description !== "" && myresult.description !== " " && {myresult.description}} + + {myresult.title || "Форма результатов"} + + + + + + + + {!showContactForm && quiz?.config.resultInfo.when !== "after" && (