From 40fb08ce0f89ea090822d8201b0e5cc61c26beeb Mon Sep 17 00:00:00 2001 From: JiSeong Kim <122510664+JSK0406@users.noreply.github.com> Date: Wed, 21 Aug 2024 18:22:39 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B0=98=EC=98=81=EB=90=98=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EC=9D=80=20=EC=BD=94=EB=93=9C=EB=A5=BC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=ED=95=A9=EB=8B=88=EB=8B=A4.=20(#264)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/quizPlay/QuizPlayPage.tsx | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/strawberry/src/pages/quizPlay/QuizPlayPage.tsx b/strawberry/src/pages/quizPlay/QuizPlayPage.tsx index 73b13eb..cee9a41 100644 --- a/strawberry/src/pages/quizPlay/QuizPlayPage.tsx +++ b/strawberry/src/pages/quizPlay/QuizPlayPage.tsx @@ -1,9 +1,11 @@ import { EventButton, Label, Wrapper, theme } from "../../core/design_system"; -import CardInput from "./components/quizInput/CardInput"; -import QuizBoard from "./components/quizBoard/QuizBoard"; +import { checkOnlyBlank } from "../../core/utils"; + import useQuizPlayData from "./hooks/useQuizPlayData"; import useQuizPlayPage from "./hooks/logics/useQuizPlayPage"; -import { checkOnlyBlank } from "../../core/utils"; + +import CardInput from "./components/quizInput/CardInput"; +import QuizBoard from "./components/quizBoard/QuizBoard"; function QuizPlayPage() { useQuizPlayData(); @@ -14,10 +16,21 @@ function QuizPlayPage() { placeholder, hint, answer, - handleSubmit, - isSubmitted, + subEventId, + postQuiz, + showBlankModal, } = useQuizPlayPage(); + function handleSubmit() { + if (checkOnlyBlank(answer)) { + showBlankModal(); + return; + } + if (subEventId) { + postQuiz({ body: { answer: answer, subEventId: subEventId } }); + } + } + return (