From b1e1817685c275387917f2de284ac24a94c579f2 Mon Sep 17 00:00:00 2001 From: Tamara Date: Thu, 4 Jan 2024 18:18:29 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=D0=B0=20=D1=88=D0=B0=D0=BF=D0=BA=D0=B8=20=D0=B2=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B7=D0=BD=D1=8B=D1=85=20=D1=81=D0=BE=D1=81=D1=82=D0=BE?= =?UTF-8?q?=D1=8F=D0=BD=D0=B8=D1=8F=D1=85(=D1=83=D0=B1=D1=80=D0=B0=D0=BB?= =?UTF-8?q?=D0=B0=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=B2=20=D0=BD=D0=B8=D1=85),=20=D0=B0=D0=B4?= =?UTF-8?q?=D0=B0=D0=BF=D1=82=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BE=D0=BA=D0=BE?= =?UTF-8?q?=D0=BD=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B8=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=B8=D0=B7=D0=BE=D0=B1=D1=80?= =?UTF-8?q?=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20+=20=D0=BC=D0=B5=D0=BB?= =?UTF-8?q?=D0=BA=D0=B8=D0=B5=20=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=BF=D0=BE=20=D0=B4=D0=B8=D0=B7=D0=B0=D0=B9=D0=BD=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AnswerDraggableList/AnswerItem.tsx | 64 ++++----- .../Questions/DataOptions/settingData.tsx | 2 +- .../Questions/DropDown/settingDropDown.tsx | 4 +- src/pages/Questions/Emoji/settingEmoji.tsx | 2 +- .../FormDraggableList/QuestionPageCard.tsx | 4 +- .../OwnTextField/settingTextField.tsx | 2 +- .../Questions/PageOptions/PageOptions.tsx | 136 ++++++++++++++++-- src/pages/Questions/QuestionsPage.tsx | 28 ++-- .../Questions/UploadFile/settingUpload.tsx | 11 +- .../UploadImage/UploadImageModal.tsx | 8 +- .../answerOptions/responseSettings.tsx | 2 +- src/pages/createQuize/MyQuizzesFull.tsx | 5 +- src/pages/createQuize/QuizCard.tsx | 1 + src/pages/main.tsx | 2 +- src/ui_kit/Header/Header.tsx | 93 ++++-------- src/ui_kit/Header/HeaderFull.tsx | 65 ++------- src/ui_kit/Modal/CropModal.tsx | 9 +- src/ui_kit/Sidebar.tsx | 6 +- src/ui_kit/Sidebar/SidebarMobile.tsx | 105 +++++++++++--- 19 files changed, 343 insertions(+), 206 deletions(-) diff --git a/src/pages/Questions/AnswerDraggableList/AnswerItem.tsx b/src/pages/Questions/AnswerDraggableList/AnswerItem.tsx index a62ff46f..6b6fc883 100644 --- a/src/pages/Questions/AnswerDraggableList/AnswerItem.tsx +++ b/src/pages/Questions/AnswerDraggableList/AnswerItem.tsx @@ -108,38 +108,38 @@ export const AnswerItem = ({ ), endAdornment: ( - - - - - - setQuestionVariantAnswer(e.target.value || " ") - } - onKeyDown={( - event: KeyboardEvent, - ) => event.stopPropagation()} - /> - + {/**/} + {/* */} + {/**/} + {/**/} + {/* */} + {/* setQuestionVariantAnswer(e.target.value || " ")*/} + {/* }*/} + {/* onKeyDown={(*/} + {/* event: KeyboardEvent,*/} + {/* ) => event.stopPropagation()}*/} + {/* />*/} + {/**/} diff --git a/src/pages/Questions/DataOptions/settingData.tsx b/src/pages/Questions/DataOptions/settingData.tsx index 8115e2e2..39a4fd7d 100644 --- a/src/pages/Questions/DataOptions/settingData.tsx +++ b/src/pages/Questions/DataOptions/settingData.tsx @@ -75,7 +75,7 @@ export default function SettingsData({ question }: SettingsDataProps) { */} */} */} (false); + + const openedModal = () => { + updateDesireToOpenABranchingModal(question.content.id); + }; + const SSHC = (data: string) => { setSwitchState(data); }; @@ -59,12 +86,105 @@ export default function PageOptions({ disableInput, question }: Props) { - - + + + {/* + + */} + copyQuestion(question.id, question.quizId)} + > + + + { + if (question.type === null) { + deleteQuestion(question.id); + } + if (question.content.rule.parentId.length !== 0) { + setOpenDelete(true); + } else { + deleteQuestionWithTimeout(question.id, () => + DeleteFunction(questions, question, quiz), + ); + } + }} + data-cy="delete-question" + > + + + setOpenDelete(false)}> + + + Вы удаляете вопрос, участвующий в ветвлении. Все его потомки + потеряют данные ветвления. Вы уверены, что хотите удалить + вопрос? + + + + + + + + + + + {/**/} + {/**/} ); } diff --git a/src/pages/Questions/QuestionsPage.tsx b/src/pages/Questions/QuestionsPage.tsx index 84e50667..df8d2a24 100755 --- a/src/pages/Questions/QuestionsPage.tsx +++ b/src/pages/Questions/QuestionsPage.tsx @@ -62,19 +62,21 @@ export default function QuestionsPage({ {quiz.name ? quiz.name : "Заголовок quiz"} - + {!openBranchingPage && ( + + )} - Настройки вопроса + + Настройки вопросов + {/* = ({ const theme = useTheme(); const dropZone = useRef(null); const [ready, setReady] = useState(false); - + const isMobile = useMediaQuery(theme.breakpoints.down(600)); const handleDragEnter = (event: DragEvent) => { event.preventDefault(); setReady(true); @@ -65,7 +66,7 @@ export const UploadImageModal: React.FC = ({ top: "50%", left: "50%", transform: "translate(-50%, -50%)", - maxWidth: "690px", + maxWidth: isMobile ? "300px" : "690px", bgcolor: "background.paper", borderRadius: "12px", boxShadow: 24, @@ -106,13 +107,14 @@ export const UploadImageModal: React.FC = ({ ref={dropZone} sx={{ width: "580px", - padding: "33px 10px 33px 55px", + padding: isMobile ? "33px" : "33px 10px 33px 55px", display: "flex", alignItems: "center", backgroundColor: theme.palette.background.default, border: `1px solid ${ready ? "red" : theme.palette.grey2.main}`, borderRadius: "8px", gap: "55px", + flexDirection: isMobile ? "column" : undefined, }} onDragEnter={handleDragEnter} // Применяем обработчик onDragEnter напрямую > diff --git a/src/pages/Questions/answerOptions/responseSettings.tsx b/src/pages/Questions/answerOptions/responseSettings.tsx index 27b77271..51546395 100644 --- a/src/pages/Questions/answerOptions/responseSettings.tsx +++ b/src/pages/Questions/answerOptions/responseSettings.tsx @@ -98,7 +98,7 @@ export default function ResponseSettings({ question }: Props) { ) : ( - + diff --git a/src/pages/main.tsx b/src/pages/main.tsx index 850e1c74..dc944572 100755 --- a/src/pages/main.tsx +++ b/src/pages/main.tsx @@ -63,7 +63,7 @@ export default function Main({ sidebar, header, footer, Page }: Props) { getData(); }, []); - const isMobile = useMediaQuery(theme.breakpoints.down(600)); + const isMobile = useMediaQuery(theme.breakpoints.down(650)); const isMobileSm = useMediaQuery(theme.breakpoints.down(370)); const isBranchingLogic = useMediaQuery(theme.breakpoints.down(1100)); const isLinkButton = useMediaQuery(theme.breakpoints.down(708)); diff --git a/src/ui_kit/Header/Header.tsx b/src/ui_kit/Header/Header.tsx index d8c29d75..6e692666 100644 --- a/src/ui_kit/Header/Header.tsx +++ b/src/ui_kit/Header/Header.tsx @@ -35,7 +35,7 @@ export const Header = ({ setMobileSidebar }: HeaderProps) => { const theme = useTheme(); const navigate = useNavigate(); const isTablet = useMediaQuery(theme.breakpoints.down(1000)); - const isMobile = useMediaQuery(theme.breakpoints.down(600)); + const isMobile = useMediaQuery(theme.breakpoints.down(650)); async function handleLogoutClick() { const [, logoutError] = await logout(); @@ -65,7 +65,11 @@ export const Header = ({ setMobileSidebar }: HeaderProps) => { }} > - {isMobile ? : } + {isMobile ? ( + + ) : ( + + )} { } fullWidth id="project-name" - placeholder="Название проекта окно" + placeholder="Название проекта" sx={{ width: "270px", "& .MuiInputBase-root": { @@ -114,67 +118,32 @@ export const Header = ({ setMobileSidebar }: HeaderProps) => { /> - {isTablet ? ( - - {isMobile ? ( - setMobileSidebar((visible: boolean) => !visible)} - style={{ fontSize: "30px", color: "white", cursor: "pointer" }} - /> - ) : ( - - {/* */} - - )} - - ) : ( - <> - - {/* */} - {/* - - - */} - - - {/* + {isMobile ? ( + setMobileSidebar((visible: boolean) => !visible)} + style={{ fontSize: "30px", color: "white", cursor: "pointer" }} + /> + ) : ( + <> + */} - - - - - )} + > + + + + + )} + ); }; diff --git a/src/ui_kit/Header/HeaderFull.tsx b/src/ui_kit/Header/HeaderFull.tsx index 97dbaadb..e2074429 100644 --- a/src/ui_kit/Header/HeaderFull.tsx +++ b/src/ui_kit/Header/HeaderFull.tsx @@ -48,18 +48,12 @@ export default function HeaderFull() { height: "80px", alignItems: "center", gap: isTablet ? "20px" : "60px", - flexDirection: isMobile ? "row-reverse" : "row", + flexDirection: "row", justifyContent: isMobile ? "space-between" : "center", bgcolor: "white", borderBottom: "1px solid #E3E3E3", }} > - {isTablet && ( - setMobileSidebar(!mobileSidebar)} - style={{ fontSize: "30px", color: "#000000", cursor: "pointer" }} - /> - )} @@ -70,56 +64,15 @@ export default function HeaderFull() { gap: "30px", overflow: "hidden", }} - > - {/* - - - - - - */} - + > )} - - {/* {!isTablet && ( - <> - - - - - - Мой баланс - - - 00.00 руб. - - - - )} */} - {!isMobile && ( - <> - {/* */} - - - )} + + diff --git a/src/ui_kit/Modal/CropModal.tsx b/src/ui_kit/Modal/CropModal.tsx index 51ae9722..9d6b2988 100644 --- a/src/ui_kit/Modal/CropModal.tsx +++ b/src/ui_kit/Modal/CropModal.tsx @@ -170,6 +170,10 @@ export const CropModal: FC = ({ padding: "20px", borderRadius: "8px", width: isMobile ? "343px" : "620px", + height: isMobile ? "80vh" : undefined, + display: isMobile ? "flex" : undefined, + flexDirection: isMobile ? "column" : undefined, + justifyContent: isMobile ? "space-evenly" : undefined, }} > = ({ sx={[ styleSlider, { - width: isMobile ? "350px" : "250px", + width: isMobile ? undefined : "250px", }, ]} value={scale * 100} @@ -278,7 +282,7 @@ export const CropModal: FC = ({ sx={[ styleSlider, { - width: isMobile ? "350px" : "250px", + width: isMobile ? undefined : "250px", }, ]} value={darken} @@ -295,6 +299,7 @@ export const CropModal: FC = ({ width: "100%", display: "flex", gap: "10px", + flexWrap: isMobile ? "wrap" : undefined, }} >