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}
+
+
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/DescriptionForm/PriceButton.tsx b/src/pages/Result/DescriptionForm/PriceButton.tsx
index 2c39f6cc..6da97916 100644
--- a/src/pages/Result/DescriptionForm/PriceButton.tsx
+++ b/src/pages/Result/DescriptionForm/PriceButton.tsx
@@ -1,66 +1,73 @@
-import { Box, Button, IconButton, SxProps, Theme, Typography } from "@mui/material";
+import {
+ Box,
+ Button,
+ IconButton,
+ SxProps,
+ Theme,
+ Typography,
+} from "@mui/material";
import { DeleteIcon } from "@icons/questionsPage/deleteIcon";
-const priceButtonsArray: { title: string; type: string; sx: SxProps }[] = [
- {
- title: "10000 ₽",
- type: "10000 ₽",
- sx: {
- width: "110px",
- height: "48px",
- border: "1px solid #9A9AAF",
+const priceButtonsArray: { title: string; type: string; sx: SxProps }[] =
+ [
+ {
+ title: "10000 ₽",
+ type: "10000 ₽",
+ sx: {
+ width: "110px",
+ height: "48px",
+ border: "1px solid #9A9AAF",
+ },
},
- },
- {
- title: "Ровно",
- type: "smooth",
- sx: {
- width: "94px",
- height: "48px",
- ml: "8px",
- border: "1px solid #9A9AAF",
+ {
+ title: "Ровно",
+ type: "smooth",
+ sx: {
+ width: "94px",
+ height: "48px",
+ border: "1px solid #9A9AAF",
+ },
},
- },
- {
- title: "От и до",
- type: "fromAndTo",
- sx: {
- width: "93px",
- height: "48px",
- ml: "8px",
- border: "1px solid #9A9AAF",
- whiteSpace: "nowrap",
+ {
+ title: "От и до",
+ type: "fromAndTo",
+ sx: {
+ width: "93px",
+ height: "48px",
+ border: "1px solid #9A9AAF",
+ whiteSpace: "nowrap",
+ },
},
- },
- {
- title: "ƒ",
- type: "ƒ",
- sx: {
- width: "38px",
- height: "48px",
- ml: "8px",
- border: "1px solid #9A9AAF",
+ {
+ title: "ƒ",
+ type: "ƒ",
+ sx: {
+ width: "38px",
+ height: "48px",
+ border: "1px solid #9A9AAF",
+ },
},
- },
- {
- title: "Скидка",
- type: "discount",
- sx: {
- width: "93px",
- height: "48px",
- border: "1px solid #9A9AAF",
- ml: "8px",
+ {
+ title: "Скидка",
+ type: "discount",
+ sx: {
+ width: "93px",
+ height: "48px",
+ border: "1px solid #9A9AAF",
+ },
},
- },
-];
+ ];
type Props = {
ButtonsActive: (index: number, type: string) => void;
priceButtonsActive: number | undefined;
};
-export default function PriceButtons({ ButtonsActive, priceButtonsActive }: Props) {
+export default function PriceButtons({
+ ButtonsActive,
+ priceButtonsActive,
+}: Props) {
return (
@@ -71,7 +78,10 @@ export default function PriceButtons({ ButtonsActive, priceButtonsActive }: Prop
-
+
{priceButtonsArray.map(({ title, type, sx }, index) => (
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
-
-
+
+
+
-
-
-
-
-
+
+
+
+
Настроить форму
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) => (
{
...sx,
bgcolor: activeIndex === index ? " #7E2AEA" : "#F2F3F7",
color: activeIndex === index ? " white" : "#9A9AAF",
+ minWidth: isSmallMonitor ? "300px" : "auto",
}}
>
{title}
@@ -92,16 +136,27 @@ export const SettingForm = () => {
))}
{typeActive === "e-mail" ? (
-
+
) : (
<>
-
+
-
+
>
)}
-
+
Создайте результат
diff --git a/src/pages/startPage/stepOne.tsx b/src/pages/startPage/stepOne.tsx
index 5163a984..6ed63f28 100755
--- a/src/pages/startPage/stepOne.tsx
+++ b/src/pages/startPage/stepOne.tsx
@@ -44,10 +44,7 @@ export default function StepOne() {
onClick={() => {
let SPageClone = listQuizes[params].config;
SPageClone.type = "form";
- updateQuizesList(params, {
- config: SPageClone,
- step: listQuizes[params].step + 1,
- });
+ updateQuizesList(params, { config: SPageClone });
}}
>
()(
return state;
},
- merge: (persistedState, currentState) => {
- const state = persistedState as QuestionStore;
+ merge: (persistedState, currentState) => {
+ const state = persistedState as QuestionStore;
- // replace blob urls with ""
- Object.values(state.listQuestions).forEach(questions => {
- questions.forEach(question => {
- if (question.type === "page" && question.content.picture.startsWith("blob:")) {
- question.content.picture = "";
- }
- if (question.type === "images") {
- question.content.variants.forEach(variant => {
- if (variant.extendedText.startsWith("blob:")) {
- variant.extendedText = "";
- }
- });
- }
- if (question.type === "varimg") {
- question.content.variants.forEach(variant => {
- if (variant.extendedText.startsWith("blob:")) {
- variant.extendedText = "";
- }
- });
- }
- });
- });
+ // replace blob urls with ""
+ Object.values(state.listQuestions).forEach((questions) => {
+ questions.forEach((question) => {
+ if (
+ question.type === "page" &&
+ question.content.picture.startsWith("blob:")
+ ) {
+ question.content.picture = "";
+ }
+ if (question.type === "images") {
+ question.content.variants.forEach((variant) => {
+ if (variant.extendedText.startsWith("blob:")) {
+ variant.extendedText = "";
+ }
+ });
+ }
+ if (question.type === "varimg") {
+ question.content.variants.forEach((variant) => {
+ if (variant.extendedText.startsWith("blob:")) {
+ variant.extendedText = "";
+ }
+ });
+ }
+ });
+ });
- return {
- ...currentState,
- ...state,
- };
- },
+ return {
+ ...currentState,
+ ...state,
+ };
+ },
}
)
);
@@ -191,13 +193,11 @@ export const createQuestion = (
export const copyQuestion = (quizId: number, copiedQuestionIndex: number) => {
const listQuestions = { ...questionStore.getState()["listQuestions"] };
- const copiedQuiz = listQuestions[quizId][copiedQuestionIndex]
- copiedQuiz.id = getRandom()
- listQuestions[quizId].splice(
- copiedQuestionIndex,
- 0,
- copiedQuiz
- );
+ const copiedQuiz = { ...listQuestions[quizId][copiedQuestionIndex] };
+ listQuestions[quizId].splice(copiedQuestionIndex, 0, {
+ ...copiedQuiz,
+ id: getRandom(),
+ });
questionStore.setState({ listQuestions });
};
@@ -238,4 +238,4 @@ function getRandom() {
const min = Math.ceil(1000000);
const max = Math.floor(10000000);
return Math.floor(Math.random() * (max - min)) + min;
-}
\ No newline at end of file
+}
diff --git a/src/ui_kit/CustomWrapper.tsx b/src/ui_kit/CustomWrapper.tsx
index 0efbbe66..b8624d25 100644
--- a/src/ui_kit/CustomWrapper.tsx
+++ b/src/ui_kit/CustomWrapper.tsx
@@ -22,7 +22,7 @@ export default function CustomWrapper({ text, sx, result }: Props) {
return (
;
- if (quizType === "form") return <>>;
if (!startpage) return ;
return ;
case 2: