From 9eea74c18e89419a06db8a597b6475903350c616 Mon Sep 17 00:00:00 2001 From: IlyaDoronin Date: Fri, 13 Oct 2023 13:52:29 +0300 Subject: [PATCH] fix: answer icons --- .../FormDraggableList/QuestionPageCard.tsx | 73 ++++--------------- .../Questions/Form/FormQuestionsPage.tsx | 10 ++- 2 files changed, 21 insertions(+), 62 deletions(-) diff --git a/src/pages/Questions/Form/FormDraggableList/QuestionPageCard.tsx b/src/pages/Questions/Form/FormDraggableList/QuestionPageCard.tsx index 255d9afd..cb7735d8 100644 --- a/src/pages/Questions/Form/FormDraggableList/QuestionPageCard.tsx +++ b/src/pages/Questions/Form/FormDraggableList/QuestionPageCard.tsx @@ -59,91 +59,46 @@ interface Props { isDragging: boolean; } -const IconAndrom = (isExpanded: boolean, switchState: string) => { +const IconAndrom = (switchState: string) => { switch (switchState) { case "variant": - return ( - - ); + return ; case "images": return ( - + ); case "varimg": return ( ); case "emoji": - return ( - - ); + return ; case "text": - return ( - - ); + return ; case "select": return ( - + ); case "date": - return ( - - ); + return ; case "number": - return ( - - ); + return ; case "file": return ( - + ); case "page": - return ( - - ); + return ; case "rating": return ( - + ); default: return ( - + ); } }; @@ -209,7 +164,7 @@ export default function QuestionsPageCard({ sx={{ cursor: "pointer" }} onClick={() => setOpen((isOpened) => !isOpened)} > - {IconAndrom(question.expanded, question.type)} + {IconAndrom(question.type)} { createQuestion(quizId); - updateQuestionsList(quizId, 0, { - expanded: true, - }); + updateQuestionsList( + quizId, + listQuestions[quizId].length - 1 || 0, + { + expanded: true, + } + ); }} >