From fb176e074038d92e53d0bfc7de1cfd458b1f8d65 Mon Sep 17 00:00:00 2001 From: Tamara Date: Wed, 13 Dec 2023 12:34:52 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BC=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=B8=20=D0=B8=D1=81=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE?= =?UTF-8?q?=D1=81=D1=8F=D0=BA=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Questions/BranchingPanel/index.tsx | 2 +- .../Questions/QuestionSwitchWindowTool.tsx | 8 +- .../Questions/SwitchBranchingPanel/index.tsx | 2 +- .../ViewPublicationPage/questions/File.tsx | 87 +++++++++++++++---- .../ViewPublicationPage/questions/Number.tsx | 1 + src/pages/startPage/EditPage.tsx | 7 +- 6 files changed, 81 insertions(+), 26 deletions(-) diff --git a/src/pages/Questions/BranchingPanel/index.tsx b/src/pages/Questions/BranchingPanel/index.tsx index 7e893b1e..3c60e56b 100644 --- a/src/pages/Questions/BranchingPanel/index.tsx +++ b/src/pages/Questions/BranchingPanel/index.tsx @@ -26,7 +26,7 @@ export const BranchingPanel = (sx?: SxProps) => { }} > { updateOpenBranchingPanel(value) }} diff --git a/src/pages/Questions/QuestionSwitchWindowTool.tsx b/src/pages/Questions/QuestionSwitchWindowTool.tsx index f7531dbb..aa2943b4 100644 --- a/src/pages/Questions/QuestionSwitchWindowTool.tsx +++ b/src/pages/Questions/QuestionSwitchWindowTool.tsx @@ -1,7 +1,7 @@ import { - Box, - } from "@mui/material"; + Box, useMediaQuery, useTheme, +} from "@mui/material"; import { DraggableList } from "./DraggableList"; import { SwitchBranchingPanel } from "./SwitchBranchingPanel"; import { BranchingMap } from "./BranchingMap"; @@ -10,9 +10,11 @@ import {useQuestionsStore} from "@root/questions/store"; export const QuestionSwitchWindowTool = () => { const {openBranchingPanel, questions} = useQuestionsStore.getState() + const theme = useTheme(); + const isMobile = useMediaQuery(theme.breakpoints.down(600)); console.log("questions ", questions) return ( - + {openBranchingPanel? : } diff --git a/src/pages/Questions/SwitchBranchingPanel/index.tsx b/src/pages/Questions/SwitchBranchingPanel/index.tsx index 4011c4b7..2c0b5bd7 100644 --- a/src/pages/Questions/SwitchBranchingPanel/index.tsx +++ b/src/pages/Questions/SwitchBranchingPanel/index.tsx @@ -25,7 +25,7 @@ export const SwitchBranchingPanel = () => { }} > { updateOpenBranchingPanel(value) }} diff --git a/src/pages/ViewPublicationPage/questions/File.tsx b/src/pages/ViewPublicationPage/questions/File.tsx index eeb7863c..6a456c1b 100644 --- a/src/pages/ViewPublicationPage/questions/File.tsx +++ b/src/pages/ViewPublicationPage/questions/File.tsx @@ -41,17 +41,77 @@ export const File = ({ currentQuestion }: FileProps) => { maxWidth: answer?.split("|")[0] ? "640px" : "550px" }} > - - - } text="5 MB максимум" /> - - {answer && currentQuestion.content.type === "picture" && ( + {answer?.split("|")[0] && ( + + Вы загрузили: + + + {answer?.split("|")[0]} + + {updateAnswer(currentQuestion.content.id, "");}} + > + + + + + + + )} + + {!answer?.split("|")[0] && ( + + + ) => event.preventDefault()} + sx={{ + width: "100%", + height: "120px", + display: "flex", + justifyContent: "space-between", + alignItems: "center", + padding: "33px 44px 33px 55px", + backgroundColor: theme.palette.background.default, + border: `1px solid ${theme.palette.grey2.main}`, + borderRadius: "8px", + }} + > + + + Добавить видео + + Принимает .mp4 и .mov формат — максимум 100мб + + + + + + )} + {answer && currentQuestion.content.type === "picture" && ( { }} /> )} - {answer?.split("|")[0] && ( - - {answer?.split("|")[0]} - - )} ); diff --git a/src/pages/ViewPublicationPage/questions/Number.tsx b/src/pages/ViewPublicationPage/questions/Number.tsx index effdc697..c5a39293 100644 --- a/src/pages/ViewPublicationPage/questions/Number.tsx +++ b/src/pages/ViewPublicationPage/questions/Number.tsx @@ -7,6 +7,7 @@ import CustomTextField from "@ui_kit/CustomTextField"; import { useQuizViewStore, updateAnswer } from "@root/quizView"; import type { QuizQuestionNumber } from "../../../model/questionTypes/number"; +import {CustomSlider} from "@ui_kit/CustomSlider"; type NumberProps = { currentQuestion: QuizQuestionNumber; diff --git a/src/pages/startPage/EditPage.tsx b/src/pages/startPage/EditPage.tsx index 3bda5a94..b9402d82 100755 --- a/src/pages/startPage/EditPage.tsx +++ b/src/pages/startPage/EditPage.tsx @@ -213,7 +213,7 @@ export default function EditPage() { sx={{ background: theme.palette.background.default, width: "100%", - padding: isMobile ? "16px" : "25px", + padding: isMobile ? "16px 16px 140px 16px" : "25px", height: "calc(100vh - 80px)", overflow: "auto", boxSizing: "border-box", @@ -258,7 +258,7 @@ export default function EditPage() { }} > { updateOpenBranchingPanel(value) }} @@ -310,9 +310,6 @@ export default function EditPage() { Логика ветвления - - Настройте связи между вопросами -