Merge branch 'dev' into 'main'

Dev

See merge request frontend/squzanswerer!19
This commit is contained in:
Nastya 2024-01-05 21:17:24 +00:00
commit 8d77fcada1
4 changed files with 10 additions and 7 deletions

@ -196,7 +196,9 @@ export const ContactForm = ({
disabled={!(ready && !fire)}
variant="contained"
onClick={async () => {
if (EMAIL_REGEXP.test(email)) {//почта валидна
//@ts-ignore
const FC: any = settings?.cfg.formContact.fields || settings?.cfg.formContact
if (FC["email"].used === EMAIL_REGEXP.test(email)) {//почта валидна
setFire(true)

@ -1,5 +1,5 @@
import { useState, useEffect } from "react";
import { Box, useTheme } from "@mui/material";
import {Box, useMediaQuery, useTheme} from "@mui/material";
import { useQuestionsStore } from "@root/quizData/store"
import { getQuestionById } from "@root/quizData/actions";
@ -46,6 +46,7 @@ const QUESTIONS_MAP: any = {
export const Question = ({ questions }: QuestionProps) => {
const { settings } = useQuestionsStore()
const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down(650));
const [currentQuestion, setCurrentQuestion] = useState<AnyTypedQuizQuestion>();
const [showContactForm, setShowContactForm] = useState<boolean>(false);
const [showResultForm, setShowResultForm] = useState<boolean>(false);
@ -71,14 +72,14 @@ export const Question = ({ questions }: QuestionProps) => {
const QuestionComponent =
QUESTIONS_MAP[currentQuestion.type as Exclude<QuestionType, "nonselected">];
const theme = useTheme();
return (
<Box
sx={{
backgroundColor: theme.palette.background.default
backgroundColor: theme.palette.background.default,
height: isMobile ? undefined : "100vh"
}}
height="100vh"
>
{!showContactForm && !showResultForm && (
<Box

@ -66,7 +66,7 @@ export const ResultForm = ({
flexDirection: "column",
alignItems: "center",
justifyContent: "space-between",
height: "100vh",
height: isMobile ? undefined : "100vh",
width: "100vw",
pt: "28px",
}}

@ -432,7 +432,7 @@ function QuizPreviewLayoutByType({
padding: "16px",
display: "flex",
flexDirection: "column",
justifyContent: "center",
justifyContent: "space-between",
alignItems: "center",
height: "100%",
"&::-webkit-scrollbar": { width: 0 },