From 81fd62c85b9b2cfed187a747dce1842584aaf1da Mon Sep 17 00:00:00 2001 From: IlyaDoronin Date: Mon, 9 Oct 2023 10:59:23 +0300 Subject: [PATCH 1/3] fix: button styles --- src/pages/Questions/ButtonsOptions.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pages/Questions/ButtonsOptions.tsx b/src/pages/Questions/ButtonsOptions.tsx index 2a785131..ad5505de 100644 --- a/src/pages/Questions/ButtonsOptions.tsx +++ b/src/pages/Questions/ButtonsOptions.tsx @@ -174,10 +174,13 @@ export default function ButtonsOptions({ : theme.palette.grey3.main, minWidth: isWrappMiniButtonSetting ? "30px" : "64px", height: "30px", + "&:hover": { + color: theme.palette.grey3.main, + "& path": { stroke: theme.palette.grey3.main }, + }, }} > {icon} - {isWrappMiniButtonSetting ? null : title} @@ -199,6 +202,10 @@ export default function ButtonsOptions({ : theme.palette.grey3.main, minWidth: isWrappMiniButtonSetting ? "30px" : "64px", height: "30px", + "&:hover": { + color: theme.palette.grey3.main, + "& path": { stroke: theme.palette.grey3.main }, + }, }} > {icon} From 9aa6fbf4116572096a164c44c6a83c27cb69fcbd Mon Sep 17 00:00:00 2001 From: IlyaDoronin Date: Mon, 9 Oct 2023 11:33:46 +0300 Subject: [PATCH 2/3] fix: 2 bugs --- src/pages/Questions/DraggableList/ChooseAnswerModal.tsx | 4 ++-- src/pages/Questions/TypeQuestions.tsx | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/pages/Questions/DraggableList/ChooseAnswerModal.tsx b/src/pages/Questions/DraggableList/ChooseAnswerModal.tsx index 1c4493ac..44150618 100644 --- a/src/pages/Questions/DraggableList/ChooseAnswerModal.tsx +++ b/src/pages/Questions/DraggableList/ChooseAnswerModal.tsx @@ -129,9 +129,9 @@ export const ChooseAnswerModal = ({ onClick={() => { setOpenModal(false); - const question = listQuestions[quizId][totalIndex]; + const question = { ...listQuestions[quizId][totalIndex] }; - removeQuestionForce(quizId, totalIndex); + removeQuestionForce(quizId, question.id); createQuestion(quizId, selectedValue, totalIndex); updateQuestionsList(quizId, totalIndex, { expanded: question.expanded, diff --git a/src/pages/Questions/TypeQuestions.tsx b/src/pages/Questions/TypeQuestions.tsx index 36560307..2b5e8007 100755 --- a/src/pages/Questions/TypeQuestions.tsx +++ b/src/pages/Questions/TypeQuestions.tsx @@ -17,7 +17,7 @@ import { questionStore, updateQuestionsList, createQuestion, - removeQuestion, + removeQuestionForce, } from "@root/questions"; import type { @@ -110,12 +110,13 @@ export default function TypeQuestions({ totalIndex }: Props) { { - const question = listQuestions[quizId][totalIndex]; + const question = { ...listQuestions[quizId][totalIndex] }; - removeQuestion(quizId, totalIndex); + removeQuestionForce(quizId, question.id); createQuestion(quizId, value, totalIndex); updateQuestionsList(quizId, totalIndex, { expanded: question.expanded, + type: value, }); }} icon={icon} From 428ba8812306b474c89f04aab909513903727544 Mon Sep 17 00:00:00 2001 From: IlyaDoronin Date: Mon, 9 Oct 2023 17:39:40 +0300 Subject: [PATCH 3/3] fix: closed answer styles --- src/assets/icons/CrossedEyeIcon.tsx | 17 +- src/assets/icons/questionsPage/OneIcon.tsx | 12 +- .../DraggableList/QuestionPageCard.tsx | 244 ++++++++++-------- src/ui_kit/CustomWrapper.tsx | 2 +- 4 files changed, 162 insertions(+), 113 deletions(-) diff --git a/src/assets/icons/CrossedEyeIcon.tsx b/src/assets/icons/CrossedEyeIcon.tsx index f2db60c7..c9021ca9 100644 --- a/src/assets/icons/CrossedEyeIcon.tsx +++ b/src/assets/icons/CrossedEyeIcon.tsx @@ -1,7 +1,16 @@ -export default function CrossedEyeIcon() { +import { FC, SVGProps } from "react"; + +export const CrossedEyeIcon: FC> = (props) => { return ( - - + + ); -} +}; diff --git a/src/assets/icons/questionsPage/OneIcon.tsx b/src/assets/icons/questionsPage/OneIcon.tsx index e7763088..64853a84 100755 --- a/src/assets/icons/questionsPage/OneIcon.tsx +++ b/src/assets/icons/questionsPage/OneIcon.tsx @@ -2,11 +2,17 @@ import { Box } from "@mui/material"; import { FC, SVGProps } from "react"; export const OneIcon: FC> = (props) => ( - - + + ); diff --git a/src/pages/Questions/DraggableList/QuestionPageCard.tsx b/src/pages/Questions/DraggableList/QuestionPageCard.tsx index 01b8d026..68b63065 100644 --- a/src/pages/Questions/DraggableList/QuestionPageCard.tsx +++ b/src/pages/Questions/DraggableList/QuestionPageCard.tsx @@ -32,7 +32,7 @@ import { DeleteIcon } from "@icons/questionsPage/deleteIcon"; import { OneIcon } from "@icons/questionsPage/OneIcon"; import { PointsIcon } from "@icons/questionsPage/PointsIcon"; import { CopyIcon } from "@icons/questionsPage/CopyIcon"; -import CrossedEyeIcon from "@icons/CrossedEyeIcon"; +import { CrossedEyeIcon } from "@icons/CrossedEyeIcon"; import { HideIcon } from "@icons/questionsPage/hideIcon"; import Answer from "@icons/questionsPage/answer"; import OptionsPict from "@icons/questionsPage/options_pict"; @@ -62,77 +62,77 @@ const IconAndrom = (isExpanded: boolean, switchState: string) => { case "variant": return ( ); case "images": return ( ); case "varimg": return ( ); case "emoji": return ( ); case "text": return ( ); case "select": return ( ); case "date": return ( ); case "number": return ( ); case "file": return ( ); case "page": return ( ); case "rating": return ( ); @@ -171,21 +171,18 @@ export default function QuestionsPageCard({ sx={{ maxWidth: "796px", width: "100%", - borderRadius: "8px", - backgroundColor: question.expanded ? "white" : "#333647", + borderRadius: "12px", + boxShadow: "none", + backgroundColor: question.expanded ? "white" : "#EEE4FC", + border: question.expanded ? "none" : "1px solid #9A9AAF", }} > - + updateQuestionsList(quizId, totalIndex, { + expanded: !question.expanded, + }) + } > - - updateQuestionsList(quizId, totalIndex, { - expanded: !question.expanded, - }) - } - > - {question.expanded ? ( - - ) : ( - - )} - {question.expanded ? ( - <> + ) : ( - - } - checkedIcon={} - /> - } - label={""} - sx={{ - color: theme.palette.grey2.main, - ml: "-9px", - mr: 0, - userSelect: "none", - }} - /> - copyQuestion(quizId, totalIndex)}> - - - { - const removedId = question.id; - if (question.deleteTimeoutId) { - clearTimeout(question.deleteTimeoutId); - } - - removeQuestion(quizId, totalIndex); - - const newTimeoutId = window.setTimeout(() => { - removeQuestionForce(quizId, removedId); - }, 5000); - - updateQuestionsList( - quizId, - totalIndex, - { - ...question, - deleteTimeoutId: newTimeoutId, - } - ); - }} - > - - - + )} + + {question.expanded ? ( + <> + ) : ( + + + } + checkedIcon={} + /> + } + label={""} + sx={{ + color: theme.palette.grey2.main, + ml: "-9px", + mr: 0, + userSelect: "none", + }} + /> + copyQuestion(quizId, totalIndex)} + > + + + { + const removedId = question.id; + if (question.deleteTimeoutId) { + clearTimeout(question.deleteTimeoutId); + } - - + removeQuestion(quizId, totalIndex); + + const newTimeoutId = window.setTimeout(() => { + removeQuestionForce(quizId, removedId); + }, 5000); + + updateQuestionsList(quizId, totalIndex, { + ...question, + deleteTimeoutId: newTimeoutId, + }); + }} + > + + + + )} + +