From e4dba30177c6df4725d5e5814e8d6bde436d5705 Mon Sep 17 00:00:00 2001 From: kuwsh1n Date: Wed, 8 May 2024 22:08:25 +0300 Subject: [PATCH] fix ticket 6, 10, 15 --- .../styles/components/loading.module.scss | 13 +++ src/assets/styles/newForm.module.scss | 3 +- src/components/AnswerModal.jsx | 5 +- src/components/Loading.jsx | 15 +++ src/components/typeAnswer/DropDownList.jsx | 2 +- src/hooks/api/formApi.js | 20 +++- src/hooks/sundry/parseListBlock.js | 11 ++- src/pages/AnswersForm.jsx | 17 ++-- src/pages/Forms.jsx | 7 +- src/pages/NewForm.jsx | 94 ++++++++++--------- src/pages/ViewForm.jsx | 1 - 11 files changed, 120 insertions(+), 68 deletions(-) create mode 100644 src/assets/styles/components/loading.module.scss create mode 100644 src/components/Loading.jsx diff --git a/src/assets/styles/components/loading.module.scss b/src/assets/styles/components/loading.module.scss new file mode 100644 index 0000000..eab817f --- /dev/null +++ b/src/assets/styles/components/loading.module.scss @@ -0,0 +1,13 @@ +.loading__wrapper { + width: 100%; + height: 80%; + display: flex; + justify-content: center; + align-items: center; + &__body { + // margin-top: 100px; + span { + + } + } +} \ No newline at end of file diff --git a/src/assets/styles/newForm.module.scss b/src/assets/styles/newForm.module.scss index afd128c..e18c9bd 100644 --- a/src/assets/styles/newForm.module.scss +++ b/src/assets/styles/newForm.module.scss @@ -171,5 +171,4 @@ } } } -} - +} \ No newline at end of file diff --git a/src/components/AnswerModal.jsx b/src/components/AnswerModal.jsx index f565d6c..0d79fb8 100644 --- a/src/components/AnswerModal.jsx +++ b/src/components/AnswerModal.jsx @@ -25,7 +25,8 @@ const AnswerModal = ({ setQuestion, setComment, setCurrentTypeAnswer, - setFile + setFile, + removeOptionAnswer }) => { return ( @@ -67,7 +68,7 @@ const AnswerModal = ({ {optionAnswer.map((item, i) => {item.id}) {item.text} - setOptionAnswer([...optionAnswer].filter(answer => answer.id !== item.id))}> + removeOptionAnswer(item.id)}> )} diff --git a/src/components/Loading.jsx b/src/components/Loading.jsx new file mode 100644 index 0000000..bc33479 --- /dev/null +++ b/src/components/Loading.jsx @@ -0,0 +1,15 @@ +import React from "react"; +import classes from "../assets/styles/components/loading.module.scss"; + +const Loading = () => { + + return ( +
+
+ Загрузка... +
+
+ ) +} + +export default Loading; \ No newline at end of file diff --git a/src/components/typeAnswer/DropDownList.jsx b/src/components/typeAnswer/DropDownList.jsx index 89cba66..621a9dd 100644 --- a/src/components/typeAnswer/DropDownList.jsx +++ b/src/components/typeAnswer/DropDownList.jsx @@ -2,7 +2,7 @@ import React, { useState } from "react"; import classes from "../../assets/styles/components/typeAnswer/dropDownList.module.scss" const DropDownList = ({postfix, optionAnswer, answers, updateAnswersForm}) => { - console.log(optionAnswer) + // console.log(optionAnswer) return (