From 8182bc1c430b63d7ab22109bb7d23dac439c27fb Mon Sep 17 00:00:00 2001 From: Tatiana Nikolaeva Date: Sun, 25 May 2025 22:46:52 +0500 Subject: [PATCH] fix question type --- .../components/AnswerOption/AnswerOption.tsx | 5 ++-- .../components/QuestionItem/QuestionItem.tsx | 26 ++++++++++++------- .../QuestionsList/QuestionsList.tsx | 24 ++++++++++------- .../src/components/Survey/Survey.tsx | 2 +- .../src/components/SurveyPage/SurveyPage.tsx | 8 +++--- .../TypeDropdown/TypeDropdown.module.css | 1 + .../components/TypeDropdown/TypeDropdown.tsx | 14 +++++----- 7 files changed, 46 insertions(+), 34 deletions(-) diff --git a/SurveyFrontend/src/components/AnswerOption/AnswerOption.tsx b/SurveyFrontend/src/components/AnswerOption/AnswerOption.tsx index 811d693..b042df9 100644 --- a/SurveyFrontend/src/components/AnswerOption/AnswerOption.tsx +++ b/SurveyFrontend/src/components/AnswerOption/AnswerOption.tsx @@ -9,7 +9,7 @@ interface AnswerOptionProps{ value: string; onChange: (value: string) => void; onDelete:(index: number) => void; - selectedType: 'single' | 'multiply'; + selectedType: 'SingleAnswerQuestion' | 'MultipleAnswerQuestion'; toggleSelect: () => void; } @@ -38,7 +38,6 @@ const AnswerOption: React.FC = ({index, value, onChange, onDe useEffect(() => { if (isEditing && textAreaRef.current) { textAreaRef.current.focus(); - // Установка начальной высоты textAreaRef.current.style.height = 'auto'; textAreaRef.current.style.height = `${textAreaRef.current.scrollHeight}px`; } @@ -72,7 +71,7 @@ const AnswerOption: React.FC = ({index, value, onChange, onDe className={`${styles.buttonMarker} ${isEditing ? styles.editing : ''}`} onClick={toggleSelect} > - {selectedType === 'single' ? < Single className={styles.answerIcon} /> : } + {selectedType === 'SingleAnswerQuestion' ? < Single className={styles.answerIcon} /> : } {isEditing ? (