diff --git a/src/assets/icons/questionsPage/StarIconMini.tsx b/src/assets/icons/questionsPage/StarIconMini.tsx index b90c1e18..561c7413 100644 --- a/src/assets/icons/questionsPage/StarIconMini.tsx +++ b/src/assets/icons/questionsPage/StarIconMini.tsx @@ -2,26 +2,21 @@ import { Box } from "@mui/material"; interface Props { color: string; + width?: string; } -export default function StarIconMini({ color }: Props) { +export default function StarIconMini({ color, width = "30px" }: Props) { return ( - + > = (props) => ( + + + + +); diff --git a/src/pages/Questions/DataOptions/DataOptions.tsx b/src/pages/Questions/DataOptions/DataOptions.tsx index 6999d77d..a25b260f 100644 --- a/src/pages/Questions/DataOptions/DataOptions.tsx +++ b/src/pages/Questions/DataOptions/DataOptions.tsx @@ -1,11 +1,5 @@ import { useParams } from "react-router-dom"; -import { - Box, - Typography, - Tooltip, - useMediaQuery, - useTheme, -} from "@mui/material"; +import { Box, Typography, Tooltip, useMediaQuery, useTheme } from "@mui/material"; import ButtonsOptions from "../ButtonsOptions"; import SwitchData from "./switchData"; import { useState, useEffect } from "react"; @@ -43,16 +37,15 @@ export default function DataOptions({ totalIndex }: Props) { width: isMobile ? "auto" : "100%", maxWidth: "493px", display: "flex", - padding: "20px", + pl: "20px", + pr: "20px", flexDirection: "column", - gap: "20px", + gap: isMobile ? "18px" : "20px", }} > { const clonContent = listQuestions[quizId][totalIndex].content; clonContent.type = "calendar"; @@ -63,9 +56,7 @@ export default function DataOptions({ totalIndex }: Props) { Использовать календарь { const clonContent = listQuestions[quizId][totalIndex].content; clonContent.type = "mask"; @@ -76,7 +67,7 @@ export default function DataOptions({ totalIndex }: Props) { Использовать маску - + - + ); diff --git a/src/pages/Questions/DataOptions/settingData.tsx b/src/pages/Questions/DataOptions/settingData.tsx index 6d5aa7f2..0359855f 100644 --- a/src/pages/Questions/DataOptions/settingData.tsx +++ b/src/pages/Questions/DataOptions/settingData.tsx @@ -1,11 +1,5 @@ import { useParams } from "react-router-dom"; -import { - Box, - Typography, - Tooltip, - useMediaQuery, - useTheme, -} from "@mui/material"; +import { Box, Typography, Tooltip, useMediaQuery, useTheme } from "@mui/material"; import { useDebouncedCallback } from "use-debounce"; import CustomCheckbox from "@ui_kit/CustomCheckbox"; import CustomTextField from "@ui_kit/CustomTextField"; @@ -22,6 +16,7 @@ export default function SettingsData({ totalIndex }: SettingsDataProps) { const theme = useTheme(); const isWrappColumn = useMediaQuery(theme.breakpoints.down(980)); const isMobile = useMediaQuery(theme.breakpoints.down(790)); + const isFigmaTablte = useMediaQuery(theme.breakpoints.down(990)); const debounced = useDebouncedCallback((value) => { let clonContent = listQuestions[quizId][totalIndex].content; @@ -37,8 +32,20 @@ export default function SettingsData({ totalIndex }: SettingsDataProps) { flexDirection: isWrappColumn ? "column" : null, }} > - - Настройки календаря + + + Настройки календаря + - Настройки вопросов + + Настройки вопросов + - + diff --git a/src/pages/Questions/DropDown/DropDown.tsx b/src/pages/Questions/DropDown/DropDown.tsx index b3f32ac9..751b2849 100644 --- a/src/pages/Questions/DropDown/DropDown.tsx +++ b/src/pages/Questions/DropDown/DropDown.tsx @@ -39,7 +39,7 @@ export default function DropDown({ totalIndex }: Props) { return ( <> - + {variants.length === 0 ? ( )} - + Добавьте ответ @@ -69,14 +81,14 @@ export default function DropDown({ totalIndex }: Props) { или нажмите Enter - + )} diff --git a/src/pages/Questions/DropDown/settingDropDown.tsx b/src/pages/Questions/DropDown/settingDropDown.tsx index 7c64908a..c7987b4a 100644 --- a/src/pages/Questions/DropDown/settingDropDown.tsx +++ b/src/pages/Questions/DropDown/settingDropDown.tsx @@ -18,6 +18,8 @@ export default function SettingDropDown({ totalIndex }: SettingDropDownProps) { const theme = useTheme(); const isTablet = useMediaQuery(theme.breakpoints.down(1000)); + const isFigmaTablte = useMediaQuery(theme.breakpoints.down(990)); + const isMobile = useMediaQuery(theme.breakpoints.down(790)); const debounced = useDebouncedCallback((value) => { let clonContent = listQuestions[quizId][totalIndex].content; @@ -43,11 +45,18 @@ export default function SettingDropDown({ totalIndex }: SettingDropDownProps) { > - + Настройки ответов - + Текст в выпадающем списке - debounceAnswer(target.value)} - /> + debounceAnswer(target.value)} + /> - - + + Настройки вопросов - + - + Текст в выпадающем списке @@ -106,7 +106,7 @@ export default function SettingTextField({ totalIndex }: SettingTextFieldProps) sx={{ pt: isMobile ? "0px" : "20px", pb: "20px", - pl: isFigmaTablte ? (isMobile ? "20px" : "34px") : "28px", + pl: isFigmaTablte ? (isWrappColumn ? "20px" : "34px") : "20px", pr: isFigmaTablte ? "19px" : "20px", display: "flex", flexDirection: "column", diff --git a/src/pages/Questions/PageOptions/PageOptions.tsx b/src/pages/Questions/PageOptions/PageOptions.tsx index 90426bf5..3597006a 100644 --- a/src/pages/Questions/PageOptions/PageOptions.tsx +++ b/src/pages/Questions/PageOptions/PageOptions.tsx @@ -12,6 +12,8 @@ import { UploadImageModal } from "../UploadImage/UploadImageModal"; import { UploadVideoModal } from "../UploadVideoModal"; import { AddPlusImage } from "@icons/questionsPage/addPlusImage"; import { AddPlusVideo } from "@icons/questionsPage/addPlusVideo"; +import { ImageAddIcons } from "@icons/ImageAddIcons"; +import { VideofileIcon } from "@icons/questionsPage/VideofileIcon"; type Props = { disableInput?: boolean; @@ -44,9 +46,9 @@ export default function PageOptions({ disableInput, totalIndex }: Props) { width: isTablet ? "auto" : "100%", maxWidth: "640px", display: "flex", - padding: "20px", + px: "20px", flexDirection: "column", - gap: "20px", + gap: isMobile ? "25px" : "20px", }} > @@ -58,6 +60,8 @@ export default function PageOptions({ disableInput, totalIndex }: Props) { - {isMobile ? : } + {isMobile ? ( + + ) : ( + + + + + + + + + + )} setOpenVideoModal(true)} /> или setOpenVideoModal(true)} sx={{ cursor: "pointer", display: "flex", @@ -110,7 +144,37 @@ export default function PageOptions({ disableInput, totalIndex }: Props) { gap: "10px", }} > - {isMobile ? : } + {isMobile ? ( + + ) : ( + + + + + + + + + + )} - + ); diff --git a/src/pages/Questions/PageOptions/SettingPageOptions.tsx b/src/pages/Questions/PageOptions/SettingPageOptions.tsx index 6808d819..11efc326 100644 --- a/src/pages/Questions/PageOptions/SettingPageOptions.tsx +++ b/src/pages/Questions/PageOptions/SettingPageOptions.tsx @@ -12,9 +12,7 @@ type SettingPageOptionsProps = { totalIndex: number; }; -export default function SettingPageOptions({ - totalIndex, -}: SettingPageOptionsProps) { +export default function SettingPageOptions({ totalIndex }: SettingPageOptionsProps) { const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down(790)); @@ -29,8 +27,20 @@ export default function SettingPageOptions({ }, 1000); return ( - - Настройки вопроса + + + Настройки вопроса + - + diff --git a/src/pages/Questions/RatingOptions/RatingOptions.tsx b/src/pages/Questions/RatingOptions/RatingOptions.tsx index e353d21a..1eca0c72 100644 --- a/src/pages/Questions/RatingOptions/RatingOptions.tsx +++ b/src/pages/Questions/RatingOptions/RatingOptions.tsx @@ -31,7 +31,7 @@ export default function RatingOptions({ totalIndex }: Props) { const isMobile = useMediaQuery(theme.breakpoints.down(790)); const buttonRatingForm: ButtonRatingFrom[] = [ - { name: "star", icon: }, + { name: "star", icon: }, { name: "trophie", icon: }, { name: "flag", icon: }, { name: "heart", icon: }, @@ -52,55 +52,50 @@ export default function RatingOptions({ totalIndex }: Props) { - {Array.from( - { length: listQuestions[quizId][totalIndex].content.steps }, - (_, index) => index - ).map((itemNumber) => ( - { - updateQuestionsList(quizId, totalIndex, { - content: { - ...listQuestions[quizId][totalIndex].content, - ratingExpanded: true, - }, - }); - }, - sx: { - cursor: "pointer", - transform: "scale(1.5)", - ":hover": { - transform: "scale(1.7)", - transition: "0.2s", + {Array.from({ length: listQuestions[quizId][totalIndex].content.steps }, (_, index) => index).map( + (itemNumber) => ( + { + updateQuestionsList(quizId, totalIndex, { + content: { + ...listQuestions[quizId][totalIndex].content, + ratingExpanded: true, + }, + }); }, - }, - } - : { sx: { transform: "scale(1.5)" } })} - > - { - buttonRatingForm.find( - ({ name }) => - listQuestions[quizId][totalIndex].content.form === name - )?.icon - } - - ))} + sx: { + cursor: "pointer", + transform: "scale(1.5)", + ":hover": { + transform: "scale(1.7)", + transition: "0.2s", + }, + }, + } + : { sx: { transform: "scale(1.5)" } })} + > + {buttonRatingForm.find(({ name }) => listQuestions[quizId][totalIndex].content.form === name)?.icon} + + ) + )} {listQuestions[quizId][totalIndex].content.ratingExpanded && (listQuestions[quizId][totalIndex].content.ratingDescription ? ( - - {listQuestions[quizId][totalIndex].content.ratingDescription} - + {listQuestions[quizId][totalIndex].content.ratingDescription} ) : ( ))} - + ); diff --git a/src/pages/Questions/RatingOptions/settingRating.tsx b/src/pages/Questions/RatingOptions/settingRating.tsx index 7b440392..9c771254 100644 --- a/src/pages/Questions/RatingOptions/settingRating.tsx +++ b/src/pages/Questions/RatingOptions/settingRating.tsx @@ -1,13 +1,5 @@ import { useParams } from "react-router-dom"; -import { - Box, - ButtonBase, - Slider, - Typography, - Tooltip, - useMediaQuery, - useTheme, -} from "@mui/material"; +import { Box, ButtonBase, Slider, Typography, Tooltip, useMediaQuery, useTheme } from "@mui/material"; import { useDebouncedCallback } from "use-debounce"; import CustomCheckbox from "@ui_kit/CustomCheckbox"; @@ -32,6 +24,7 @@ type SettingSliderProps = { export default function SettingSlider({ totalIndex }: SettingSliderProps) { const quizId = Number(useParams().quizId); const theme = useTheme(); + const isFigmaTablte = useMediaQuery(theme.breakpoints.down(990)); const isMobile = useMediaQuery(theme.breakpoints.down(790)); const isWrappColumn = useMediaQuery(theme.breakpoints.down(980)); const { listQuestions } = questionStore(); @@ -62,48 +55,60 @@ export default function SettingSlider({ totalIndex }: SettingSliderProps) { flexDirection: isWrappColumn ? "column" : null, }} > - - + + Настройки рейтинга - - Форма - - - {buttonRatingForm.map(({ name, icon }, index) => ( - { - const clonContent = listQuestions[quizId][totalIndex].content; - clonContent.form = name; - updateQuestionsList(quizId, totalIndex, { - content: clonContent, - }); - }} - sx={{ - backgroundColor: - listQuestions[quizId][totalIndex].content.form === name - ? theme.palette.brightPurple.main - : "transparent", - color: - listQuestions[quizId][totalIndex].content.form === name - ? "#ffffff" - : theme.palette.grey3.main, - width: "40px", - height: "40px", - borderRadius: "4px", - }} - > - {icon} - - ))} + + + Форма + + + {buttonRatingForm.map(({ name, icon }, index) => ( + { + const clonContent = listQuestions[quizId][totalIndex].content; + clonContent.form = name; + updateQuestionsList(quizId, totalIndex, { + content: clonContent, + }); + }} + sx={{ + backgroundColor: + listQuestions[quizId][totalIndex].content.form === name + ? theme.palette.brightPurple.main + : "transparent", + color: listQuestions[quizId][totalIndex].content.form === name ? "#ffffff" : theme.palette.grey3.main, + width: "40px", + height: "40px", + borderRadius: "4px", + }} + > + {icon} + + ))} + + { const clonContent = listQuestions[quizId][totalIndex].content; clonContent.steps = Number(value) || 1; @@ -127,8 +132,21 @@ export default function SettingSlider({ totalIndex }: SettingSliderProps) { }} /> - - Настройки вопросов + + + Настройки вопросов + - + diff --git a/src/pages/Questions/SliderOptions/SliderOptions.tsx b/src/pages/Questions/SliderOptions/SliderOptions.tsx index 0706b7a2..aee43d23 100644 --- a/src/pages/Questions/SliderOptions/SliderOptions.tsx +++ b/src/pages/Questions/SliderOptions/SliderOptions.tsx @@ -28,19 +28,22 @@ export default function SliderOptions({ totalIndex }: Props) { - - + + Выбор значения из диапазона - + - Шаг + Шаг { let clonContent = listQuestions[quizId][totalIndex].content; @@ -36,9 +31,20 @@ export default function SettingSlider({ totalIndex }: SettingSliderProps) { flexDirection: isWrappColumn ? "column" : null, }} > - - - Настройки ползунка + + + Настройки ползунка + - - Настройки вопросов + + + Настройки вопросов + - + diff --git a/src/pages/Questions/UploadFile/UploadFile.tsx b/src/pages/Questions/UploadFile/UploadFile.tsx index a500348c..114317a1 100644 --- a/src/pages/Questions/UploadFile/UploadFile.tsx +++ b/src/pages/Questions/UploadFile/UploadFile.tsx @@ -36,6 +36,7 @@ export default function UploadFile({ totalIndex }: Props) { const { listQuestions } = questionStore(); const theme = useTheme(); const isTablet = useMediaQuery(theme.breakpoints.down(980)); + const isMobile = useMediaQuery(theme.breakpoints.down(790)); const SSHC = (data: string) => { setSwitchState(data); @@ -64,9 +65,8 @@ export default function UploadFile({ totalIndex }: Props) { width: isTablet ? "auto" : "100%", maxWidth: "640px", display: "flex", - padding: "20px", + px: "20px", flexDirection: "column", - gap: "20px", }} > @@ -145,7 +145,14 @@ export default function UploadFile({ totalIndex }: Props) { - + - Настройки вопроса + + + Настройки вопроса + - +