diff --git a/src/pages/Questions/DraggableList/QuestionPageCard.tsx b/src/pages/Questions/DraggableList/QuestionPageCard.tsx index 078c96e6..9c2488d7 100644 --- a/src/pages/Questions/DraggableList/QuestionPageCard.tsx +++ b/src/pages/Questions/DraggableList/QuestionPageCard.tsx @@ -49,7 +49,10 @@ import { ArrowDownIcon } from "@icons/questionsPage/ArrowDownIcon"; import { ReactComponent as PlusIcon } from "../../../assets/icons/plus.svg"; import type { DraggableProvidedDragHandleProps } from "react-beautiful-dnd"; -import type { AnyQuizQuestion, QuizQuestionInitial } from "../../../model/questionTypes/shared"; +import type { + AnyQuizQuestion, + QuizQuestionInitial, +} from "../../../model/questionTypes/shared"; interface Props { totalIndex: number; diff --git a/src/pages/Result/CreationFullCard.tsx b/src/pages/Result/CreationFullCard.tsx index bfc62d82..ebef6ed7 100644 --- a/src/pages/Result/CreationFullCard.tsx +++ b/src/pages/Result/CreationFullCard.tsx @@ -1,4 +1,4 @@ -import { Box, Typography } from "@mui/material"; +import { Box, Typography, useTheme, useMediaQuery } from "@mui/material"; type Props = { text: string; @@ -7,14 +7,20 @@ type Props = { }; export default function CreationFullCard({ text, text2, image }: Props) { + const theme = useTheme(); + const isSmallMonitor = useMediaQuery(theme.breakpoints.down(1500)); + return ( - - Результаты квиза в зависимости от ответов - + + Результаты квиза в зависимости от ответов + + - {text} - - - {text2} - + + {text} + + + {text2} + + quiz creation diff --git a/src/pages/Result/DescriptionForm/ButtinsOptionsForm.tsx b/src/pages/Result/DescriptionForm/ButtinsOptionsForm.tsx index 27c8366e..b332bafd 100644 --- a/src/pages/Result/DescriptionForm/ButtinsOptionsForm.tsx +++ b/src/pages/Result/DescriptionForm/ButtinsOptionsForm.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Box, IconButton, useTheme } from "@mui/material"; +import { Box, IconButton, useTheme, useMediaQuery } from "@mui/material"; import MiniButtonSetting from "@ui_kit/MiniButtonSetting"; import SettingIcon from "@icons/questionsPage/settingIcon"; import Branching from "@icons/questionsPage/branching"; @@ -15,20 +15,39 @@ interface Props { export default function ButtonsOptionsForm({ SSHC, switchState }: Props) { const theme = useTheme(); + const isTablet = useMediaQuery(theme.breakpoints.down(800)); const buttonSetting: { icon: JSX.Element; title: string; value: string }[] = [ { - icon: , + icon: ( + + ), title: "Настройки", value: "setting", }, { - icon: , + icon: ( + + ), title: "Ветвление", value: "branching", }, { - icon: , + icon: ( + + ), title: "Баллы", value: "points", }, @@ -47,6 +66,7 @@ export default function ButtonsOptionsForm({ SSHC, switchState }: Props) { sx={{ padding: "20px", display: "flex", + flexWrap: "wrap", gap: "10px", }} > @@ -57,18 +77,23 @@ export default function ButtonsOptionsForm({ SSHC, switchState }: Props) { SSHC(value); }} sx={{ - backgroundColor: switchState === value ? theme.palette.brightPurple.main : "transparent", - color: switchState === value ? "#ffffff" : theme.palette.grey3.main, + backgroundColor: + switchState === value + ? theme.palette.brightPurple.main + : "transparent", + color: + switchState === value ? "#ffffff" : theme.palette.grey3.main, }} > {icon} - {title} + {!isTablet && title} ))} diff --git a/src/pages/Result/DescriptionForm/DescriptionForm.tsx b/src/pages/Result/DescriptionForm/DescriptionForm.tsx index a0c84f05..788078f3 100644 --- a/src/pages/Result/DescriptionForm/DescriptionForm.tsx +++ b/src/pages/Result/DescriptionForm/DescriptionForm.tsx @@ -31,10 +31,12 @@ export const DescriptionForm = () => { return ( @@ -57,7 +59,10 @@ export const DescriptionForm = () => { - + @@ -85,7 +90,10 @@ export const DescriptionForm = () => { {priceButtonsType === "smooth" ? ( - + Призыв к действию @@ -127,8 +135,13 @@ export const DescriptionForm = () => { {forwarding ? ( - - + + Переадресация diff --git a/src/pages/Result/DescriptionForm/DiscountButtons.tsx b/src/pages/Result/DescriptionForm/DiscountButtons.tsx index 149e1cac..07213f59 100644 --- a/src/pages/Result/DescriptionForm/DiscountButtons.tsx +++ b/src/pages/Result/DescriptionForm/DiscountButtons.tsx @@ -14,7 +14,10 @@ export default function DiscountButtons() { - + - - + + + + + ); diff --git a/src/pages/Result/ResultListForm.tsx b/src/pages/Result/ResultListForm.tsx index de04050f..2e47fd96 100644 --- a/src/pages/Result/ResultListForm.tsx +++ b/src/pages/Result/ResultListForm.tsx @@ -12,9 +12,11 @@ import CustomCheckbox from "@ui_kit/CustomCheckbox"; export const ResultListForm = () => { const [alignType, setAlignType] = useState<"left" | "right">("left"); - const [proportions, setProportions] = useState<"oneOne" | "twoOne" | "oneTwo">("oneOne"); + const [proportions, setProportions] = useState< + "oneOne" | "twoOne" | "oneTwo" + >("oneOne"); return ( - + { mb: "20px", }} > - Показывать результат + + Показывать результат + - + { /> - + diff --git a/src/pages/Result/Setting.tsx b/src/pages/Result/Setting.tsx index 945c2ac9..6975eb19 100644 --- a/src/pages/Result/Setting.tsx +++ b/src/pages/Result/Setting.tsx @@ -8,18 +8,18 @@ import Info from "@icons/Info"; import IconPlus from "@icons/IconPlus"; import ArrowLeft from "@icons/questionsPage/arrowLeft"; import React from "react"; -import {quizStore} from "@root/quizes"; -import {useParams} from "react-router-dom"; +import { quizStore } from "@root/quizes"; +import { useParams } from "react-router-dom"; export const Setting = () => { - const {listQuizes, updateQuizesList} = quizStore(); - const params = Number(useParams().quizId); - const handleNext = () => { - updateQuizesList(params, {step: listQuizes[params].step + 1}) - } + const { listQuizes, updateQuizesList } = quizStore(); + const params = Number(useParams().quizId); + const handleNext = () => { + updateQuizesList(params, { step: listQuizes[params].step + 1 }); + }; const theme = useTheme(); return ( - + Настройки результатов @@ -46,7 +46,9 @@ export const Setting = () => { - + Создайте результат @@ -70,22 +72,39 @@ export const Setting = () => { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - + diff --git a/src/pages/Result/SettingForm.tsx b/src/pages/Result/SettingForm.tsx index 1242b1ff..af49f3c5 100644 --- a/src/pages/Result/SettingForm.tsx +++ b/src/pages/Result/SettingForm.tsx @@ -1,5 +1,14 @@ import { useState } from "react"; -import { Box, Button, IconButton, SxProps, Theme, Typography } from "@mui/material"; +import { + Box, + Button, + IconButton, + SxProps, + Theme, + Typography, + useTheme, + useMediaQuery, +} from "@mui/material"; import { SwitchSetting } from "./SwichResult"; import Info from "@icons/Info"; @@ -10,17 +19,35 @@ import ArrowCounterClockWise from "@icons/ArrowCounterClockWise.svg"; const buttonSetting: { title: string; sx: SxProps; type: string }[] = [ { - sx: { backgroundColor: "#7E2AEA", color: "white", width: "237px", height: "44px", border: "1px solid #9A9AAF" }, + sx: { + backgroundColor: "#7E2AEA", + color: "white", + width: "237px", + height: "44px", + border: "1px solid #9A9AAF", + }, title: "До формы контактов", type: "toContactForm", }, { - sx: { backgroundColor: "#F2F3F7", color: "#9A9AAF", width: "266px", height: "44px", border: "1px solid #9A9AAF" }, + sx: { + backgroundColor: "#F2F3F7", + color: "#9A9AAF", + width: "266px", + height: "44px", + border: "1px solid #9A9AAF", + }, title: "После формы контактов", type: "afterСontactForm", }, { - sx: { color: "#9A9AAF", backgroundColor: "#F2F3F7", width: "233px", height: "44px", border: "1px solid #9A9AAF" }, + sx: { + color: "#9A9AAF", + backgroundColor: "#F2F3F7", + width: "233px", + height: "44px", + border: "1px solid #9A9AAF", + }, title: "Отправить на E-mail", type: "e-mail", }, @@ -29,6 +56,8 @@ const buttonSetting: { title: string; sx: SxProps; type: string }[] = [ export const SettingForm = () => { const [activeIndex, setActiveIndex] = useState(0); const [typeActive, setTypeActive] = useState("toContactForm"); + const theme = useTheme(); + const isSmallMonitor = useMediaQuery(theme.breakpoints.down(1100)); const active = (index: number, type: string) => { setActiveIndex(index); @@ -36,7 +65,7 @@ export const SettingForm = () => { }; return ( - + Настройки результатов @@ -63,7 +92,13 @@ export const SettingForm = () => { Показывать результат - + { - + {buttonSetting.map(({ sx, title, type }, index) => (