From 584db3eec2c85f3f3f95aaa98d1c95814d402a21 Mon Sep 17 00:00:00 2001 From: Nastya Date: Thu, 26 Sep 2024 22:51:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=BC=D0=B5=D1=82=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B2=D0=B2=D0=B5=D1=81=D1=82=D0=B8=20=D1=81=D0=B2=D0=BE=D0=B9?= =?UTF-8?q?=20=D0=BE=D1=82=D0=B2=D0=B5=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../questions/Emoji/EmojiVariant.tsx | 16 +- .../questions/Images/ImageVariant.tsx | 14 +- .../questions/Variant/VariantItem.tsx | 35 ++- .../questions/Varimg/VarimgVariant.tsx | 215 +++++++++++++----- 4 files changed, 201 insertions(+), 79 deletions(-) diff --git a/lib/components/ViewPublicationPage/questions/Emoji/EmojiVariant.tsx b/lib/components/ViewPublicationPage/questions/Emoji/EmojiVariant.tsx index b6f9e72..525b0e8 100644 --- a/lib/components/ViewPublicationPage/questions/Emoji/EmojiVariant.tsx +++ b/lib/components/ViewPublicationPage/questions/Emoji/EmojiVariant.tsx @@ -66,6 +66,7 @@ const OwnInput = ({ questionId, variant, largeCheck, ownPlaceholder }: OwnInputP backgroundColor: theme.palette.primary.main, }, scrollbarColor: theme.palette.primary.main, + overflow: "auto", }} value={ownAnswer} onClick={(e: React.MouseEvent) => e.stopPropagation()} @@ -171,6 +172,17 @@ export const EmojiVariant = ({ {variant.extendedText && {variant.extendedText}} + {own && ( + + Введите свой ответ + + )} + {own && ( + + Введите свой ответ + + )} + <> + + Введите свой ответ + + + ) : ( variant.answer ) diff --git a/lib/components/ViewPublicationPage/questions/Varimg/VarimgVariant.tsx b/lib/components/ViewPublicationPage/questions/Varimg/VarimgVariant.tsx index 6269dbd..90f2029 100644 --- a/lib/components/ViewPublicationPage/questions/Varimg/VarimgVariant.tsx +++ b/lib/components/ViewPublicationPage/questions/Varimg/VarimgVariant.tsx @@ -1,6 +1,16 @@ import type { QuestionVariant } from "@/model/questionTypes/shared"; import { useQuizSettings } from "@contexts/QuizDataContext"; -import { FormControlLabel, TextareaAutosize, Radio, useTheme, Box, Input } from "@mui/material"; +import { + FormControlLabel, + TextareaAutosize, + Radio, + useTheme, + Box, + Input, + FormControl, + InputLabel, + Typography, +} from "@mui/material"; import { useQuizViewStore } from "@stores/quizView"; import RadioCheck from "@ui_kit/RadioCheck"; import RadioIcon from "@ui_kit/RadioIcon"; @@ -54,6 +64,7 @@ const OwnInput = ({ questionId, variant, largeCheck, ownPlaceholder }: OwnInputP }, scrollbarColor: theme.palette.primary.main, maxHeight: "44px", + overflow: "auto", }} value={ownAnswer} onClick={(e: React.MouseEvent) => e.stopPropagation()} @@ -104,67 +115,145 @@ export const VarimgVariant = ({ } }; - return ( - - ) : ( - variant.answer - ) - } - control={ - } - icon={} + if (variant?.isOwn) { + return ( + + + Введите свой ответ + + + + ) : ( + variant.answer + ) + } + control={ + } + icon={} + /> + } /> - } - /> - ); + + ); + } else { + return ( + + ) : ( + variant.answer + ) + } + control={ + } + icon={} + /> + } + /> + ); + } };