From 12e250d9a47bf83d593856f5f5238c20f5616a51 Mon Sep 17 00:00:00 2001 From: Tamara Date: Wed, 7 Jun 2023 17:20:45 +0300 Subject: [PATCH] =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D1=81?= =?UTF-8?q?=20=D0=B4=D0=B5=D1=81=D0=BA=D1=82=D0=BE=D0=BF=D0=B0=D0=BC=D0=B8?= =?UTF-8?q?=2037,=2039=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B0=D1=87=D0=B8=20?= =?UTF-8?q?=D1=80=D0=B5=D0=B7=D1=83=D0=BB=D1=8C=D1=82=D0=B0=D1=82=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=B2=D1=8B=D0=B1=D0=BE=D1=80=D0=B0=20=D0=B2=20=D1=81?= =?UTF-8?q?=D0=B5=D0=BB=D0=B5=D0=BA=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/startPage/CardWithImage.tsx | 4 +- src/pages/startPage/StartPageSettings.tsx | 431 +++++++++++----------- src/pages/startPage/steptwo.tsx | 9 +- src/stores/quizes.ts | 62 ++-- 4 files changed, 264 insertions(+), 242 deletions(-) diff --git a/src/pages/startPage/CardWithImage.tsx b/src/pages/startPage/CardWithImage.tsx index fb3f83f3..68354add 100755 --- a/src/pages/startPage/CardWithImage.tsx +++ b/src/pages/startPage/CardWithImage.tsx @@ -4,15 +4,17 @@ import { Box, Typography, useTheme } from "@mui/material"; interface Props { image: string; text: string; + border?: string; } -export default function CardWithImage({ image, text }: Props) { +export default function CardWithImage({ image, text, border }: Props) { const theme = useTheme(); return ( (designTypes[0][0]); + const designType = listQuizes[params].startpage + // const [designType, setDesignType] = useState(designTypes[0][0]); const [backgroundType, setBackgroundType] = useState("image"); const [alignType, setAlignType] = useState("left"); return ( - + - - Дизайн - - - - Фон - - setBackgroundType("image")}> - Изображение - - setBackgroundType("video")}> - Видео - - - {backgroundType === "image" ? - <> - Изображение - } text="5 MB максимум" /> - Размер картинок - } + > + {designTypes.map(type => + - + sx={{ + display: "flex", + alignItems: "center", + gap: "20px", + p: "4px", + borderRadius: "5px", + color: theme.palette.grey2.main, + }} + > + {type[1](type[0] === designType ? theme.palette.orange.main : theme.palette.grey2.main)} + {type[0]} + + )} + + + Фон + + setBackgroundType("image")}> + Изображение + + setBackgroundType("video")}> + Видео + + + {backgroundType === "image" ? + <> + Изображение + } text="5 MB максимум" /> мобильная версия - - - : - <> - - Добавить видео - - + color: theme.palette.orange.main, + textDecorationColor: theme.palette.orange.main + }}>Размер картинок + + + мобильная версия + + + : + <> + + Добавить видео + + + } + sx={{ + height: "48px", + width: "48px", + }} + /> + Настройки видео + + Изображение для мобильной версии + } text="5 MB максимум" /> + + } + Расположение элементов + + setAlignType("left")} isActive={alignType === "left"} Icon={AlignLeftIcon} /> + setAlignType("right")} isActive={alignType === "right"} Icon={AlignRightIcon} /> + + {backgroundType === "image" && + + Логотип + } + } text="5 MB максимум" /> + + Favicon + } sx={{ @@ -187,91 +229,64 @@ export default function StartPageSettings() { width: "48px", }} /> - Настройки видео - - Изображение для мобильной версии - } text="5 MB максимум" /> - - } - Расположение элементов - - setAlignType("left")} isActive={alignType === "left"} Icon={AlignLeftIcon} /> - setAlignType("right")} isActive={alignType === "right"} Icon={AlignRightIcon} /> + 5 MB максимум + - {backgroundType === "image" && - - Логотип - } - } text="5 MB максимум" /> - - Favicon - } - sx={{ - height: "48px", - width: "48px", - }} - /> - Заголовок + + Текст + + Текст кнопки + + Телефон + + + Название или слоган компании + + Сайт + + Юридическая информация + + 5 MB максимум + color: theme.palette.brightPurple.main, + textDecorationColor: theme.palette.brightPurple.main + }}>Дополнительно + Mета заголовок + + + Текст-заполнитель — + это текст, который имеет Текст-заполнитель — + это текст, который имеет Текст-заполнитель — + это текст, который имеет Текст-заполнитель — + это текст, который имеет Текст-заполнитель + - - Заголовок - - Текст - - Текст кнопки - - Телефон - - - Название или слоган компании - - Сайт - - Юридическая информация - - Дополнительно - Mета заголовок - - - Текст-заполнитель — - это текст, который имеет Текст-заполнитель — - это текст, который имеет Текст-заполнитель — - это текст, который имеет Текст-заполнитель — - это текст, который имеет Текст-заполнитель - + + + - + + ); } diff --git a/src/pages/startPage/steptwo.tsx b/src/pages/startPage/steptwo.tsx index 0bb2da06..ecb4c6d4 100755 --- a/src/pages/startPage/steptwo.tsx +++ b/src/pages/startPage/steptwo.tsx @@ -26,24 +26,27 @@ export default function Steptwo ({handleNext}:HandleNext) { }}> diff --git a/src/stores/quizes.ts b/src/stores/quizes.ts index dfd2c8bb..68962131 100644 --- a/src/stores/quizes.ts +++ b/src/stores/quizes.ts @@ -35,41 +35,15 @@ interface Quizes { average_time: number, super: true, group_id: number, - step: number + step: number, + startpage: string, + config1?: any } export const quizStore = create()( persist( (set, get) => ({ listQuizes: { - // 1: { - // "id": 0, - // "qid": "string", - // "deleted": false, - // "archived": true, - // "fingerprinting": true, - // "repeatable": true, - // "note_prevented": true, - // "mail_notifications": true, - // "unique_answers": true, - // "name": "string", - // "description": "string", - // "config": "string", - // "status": "string", - // "limit": 0, - // "due_to": 0, - // "time_of_passing": 0, - // "pausable": true, - // "version": 0, - // "version_comment": "string", - // "created_at": "string", - // "updated_at": "string", - // "question_cnt": 0, - // "passed_count": 0, - // "average_time": 0, - // "super": true, - // "group_id": 0 - // } }, updateQuizesList: (id: number, values: any) => { const state = get()["listQuizes"] || {}; @@ -120,7 +94,35 @@ export const quizStore = create()( "average_time": 0, "super": true, "group_id": 0, - "step": 1 + "step": 1, + "startpage": "", + "config1": { + "type": "", // quiz или form + "favicon": [ + {"attrs": "320*650apple","link":"hub.pena.digital/fav/squiz1.jpg"} + ], + "logo": "hub.pena.digital/img/logo", + "startpage": { + "description": "",// приветственный текст опроса + "button": "Начать", // текст на кнопке начала опроса + "position": "ltr", // ltr или rtl. отображение элементов поверх фона + "background": { + "type": "image", //image или video + "desctop": "hub.pena.digital/img/back/full.png", + "mobile": "hub.pena.digital/img/back/mobile.png", + "video":"hub.pena.digital/vid/back/vi1.mp4", + "cycle": true //зацикливать видео или нет + }, + }, + "info": { + "phonenumber": "+79885895677", + "clickable": true, + "orgname": "ООО \"Пена\"", + "site": "hub.pena.digital", + "law": "юридическая информация" + }, + "meta": "что-то" + } }; set({listQuizes: newListQuizes}); return id;