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 (