From 7f7370cb1b55670793e204d23cb4d8e9b196e708 Mon Sep 17 00:00:00 2001 From: Tamara Date: Fri, 5 Jan 2024 17:43:28 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B5=D1=89=D1=91=20=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=BF=D0=BE=20=D0=B0=D0=B4=D0=B0=D0=BF=D1=82?= =?UTF-8?q?=D0=B8=D0=B2=D0=BD=D0=BE=D1=81=D1=82=D0=B8=20=D1=82=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=BE=D0=B2=D0=BE=D0=B9=20=D0=BF=D1=83=D0=B1=D0=BB=D0=B8?= =?UTF-8?q?=D0=BA=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ViewPublicationPage/ContactForm.tsx | 9 ++++---- src/pages/ViewPublicationPage/Footer.tsx | 4 ++-- src/pages/ViewPublicationPage/Question.tsx | 20 ++++++++-------- src/pages/ViewPublicationPage/ResultForm.tsx | 23 ++++++++++++++----- .../StartPageViewPublication.tsx | 16 +++++++++---- .../ViewPublicationPage/questions/Variant.tsx | 10 +++++++- src/pages/main.tsx | 2 +- src/ui_kit/StartPagePreview/index.tsx | 1 + 8 files changed, 58 insertions(+), 27 deletions(-) diff --git a/src/pages/ViewPublicationPage/ContactForm.tsx b/src/pages/ViewPublicationPage/ContactForm.tsx index 33a11260..5e9a9f63 100644 --- a/src/pages/ViewPublicationPage/ContactForm.tsx +++ b/src/pages/ViewPublicationPage/ContactForm.tsx @@ -114,8 +114,6 @@ export const ContactForm = ({ borderRadius: "4px", overflow: "auto", height: "90vh", - boxShadow: - "rgba(0, 0, 0, 0.2) 0px 2px 1px -1px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px", }} > @@ -133,6 +131,7 @@ export const ContactForm = ({ {quiz?.config.formContact.desc && ( - + С  Положением об обработке персональных данных  и  @@ -328,7 +327,9 @@ const CustomInput = ({ title, desc, Icon }: any) => { const isMobile = useMediaQuery(theme.breakpoints.down(600)); return ( - {title} + + {title} + { - console.log("Следующий результат будет вот такой" , nextQuestion) + console.log("Следующий результат будет вот такой", nextQuestion); if (nextQuestion && quiz?.config.resultInfo.when === "email") { setShowContactForm(true); return; @@ -242,7 +242,7 @@ export const Footer = ({ }; const followNextStep = () => { - console.log(" Я понимаю что нахожусь в линейном опроснике" + linear) + console.log(" Я понимаю что нахожусь в линейном опроснике" + linear); if (linear) { setStepNumber((q) => q + 1); const questionIndex = questions.findIndex(({ id }) => id === question.id); diff --git a/src/pages/ViewPublicationPage/Question.tsx b/src/pages/ViewPublicationPage/Question.tsx index 2bb555dd..fe54fce5 100644 --- a/src/pages/ViewPublicationPage/Question.tsx +++ b/src/pages/ViewPublicationPage/Question.tsx @@ -90,15 +90,17 @@ export const Question = ({ questions }: QuestionProps) => { }} > - {mode[quiz.config.theme] ? ( - - ) : ( - - )} + + {mode[quiz.config.theme] ? ( + + ) : ( + + )} + )} {showResultForm && quiz?.config.resultInfo.when === "before" && ( diff --git a/src/pages/ViewPublicationPage/ResultForm.tsx b/src/pages/ViewPublicationPage/ResultForm.tsx index 5bc458a0..357a9afa 100644 --- a/src/pages/ViewPublicationPage/ResultForm.tsx +++ b/src/pages/ViewPublicationPage/ResultForm.tsx @@ -44,17 +44,19 @@ export const ResultForm = ({ ) || questions.find( (question) => - question.type === "result" && question.content.rule.parentId === "line", + question.type === "result" && + question.content.rule.parentId === "line", )) as AnyTypedQuizQuestion; } else { return questions.find( (question) => - question.type === "result" && question.content.rule.parentId === "line", + question.type === "result" && + question.content.rule.parentId === "line", ) as AnyTypedQuizQuestion; } - } + }; - const resultQuestion = searchResult() + const resultQuestion = searchResult(); const followNextForm = () => { setShowResultForm(false); @@ -62,7 +64,7 @@ export const ResultForm = ({ }; if (resultQuestion === undefined) return <>; - console.log("Я форма показа резултата и он такой ", resultQuestion) + console.log("Я форма показа резултата и он такой ", resultQuestion); return ( {resultQuestion.description} @@ -120,6 +123,7 @@ export const ResultForm = ({ {resultQuestion.title} @@ -132,6 +136,7 @@ export const ResultForm = ({ sx={{ fontSize: "18px", m: "20px 0", + color: theme.palette.text.primary, }} > {resultQuestion.content.text} @@ -153,9 +158,15 @@ export const ResultForm = ({ display: "flex", alignItems: "center", mt: "15px", + gap: "10px", }} > - + { const mode = modes; const { isMobileDevice } = useUADevice(); const isMobile = useMediaQuery(theme.breakpoints.down(650)); + const isTablet = useMediaQuery(theme.breakpoints.down(1000)); if (!quiz) return null; @@ -100,7 +101,6 @@ export const StartPageViewPublication = ({ setVisualStartPage }: Props) => { ? "linear-gradient(180deg,transparent,#272626)" : "linear-gradient(270deg,#272626,transparent)" : theme.palette.background.default, - color: quiz.config.startpageType === "expanded" ? "white" : "black", }} > @@ -197,6 +197,10 @@ export const StartPageViewPublication = ({ setVisualStartPage }: Props) => { quiz.config.startpageType === "centered" ? "center" : "-moz-initial", + color: + quiz.config.startpageType === "expanded" && !isMobile + ? "white" + : theme.palette.text.primary, }} > {quiz.config.startpage.description} @@ -229,10 +233,10 @@ export const StartPageViewPublication = ({ setVisualStartPage }: Props) => { sx={{ mt: "46px", display: "flex", - alignItems: "center", + alignItems: isTablet ? "start" : "center", justifyContent: "space-between", width: "100%", - flexDirection: isMobile ? "column" : "row", + flexDirection: isTablet ? "column" : "row", }} > @@ -272,7 +276,11 @@ export const StartPageViewPublication = ({ setVisualStartPage }: Props) => { width: "100%", overflowWrap: "break-word", fontSize: "12px", - textAlign: "end", + textAlign: isTablet ? "start" : "end", + color: + quiz.config.startpageType === "expanded" && !isMobile + ? "white" + : theme.palette.text.primary, }} > {quiz.config.info.law} diff --git a/src/pages/ViewPublicationPage/questions/Variant.tsx b/src/pages/ViewPublicationPage/questions/Variant.tsx index 12883911..bcd9e650 100644 --- a/src/pages/ViewPublicationPage/questions/Variant.tsx +++ b/src/pages/ViewPublicationPage/questions/Variant.tsx @@ -9,6 +9,7 @@ import { Checkbox, TextField, useTheme, + useMediaQuery, } from "@mui/material"; import { @@ -43,6 +44,7 @@ type VariantItemProps = { export const Variant = ({ currentQuestion }: VariantProps) => { const theme = useTheme(); + const isMobile = useMediaQuery(theme.breakpoints.down(650)); const { answers, ownVariants } = useQuizViewStore(); const { answer } = answers.find( @@ -65,7 +67,13 @@ export const Variant = ({ currentQuestion }: VariantProps) => { {currentQuestion.title} - + )} - {currentStep === 1 && ( + {currentStep <= 1 && ( { overflow: "hidden", pointerEvents: "auto", borderRadius: "5px", + boxShadow: "0px 5px 10px 2px rgba(34, 60, 80, 0.2)", }} >