Skip to content

Commit

Permalink
반영되지 않은 코드를 추가합니다. (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
JSK0406 authored Aug 21, 2024
1 parent 9cbc295 commit 40fb08c
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions strawberry/src/pages/quizPlay/QuizPlayPage.tsx
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -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 (
<Wrapper
$backgroundcolor={theme.Color.Ivory.ivory500}
Expand Down Expand Up @@ -58,9 +71,7 @@ function QuizPlayPage() {
<EventButton
type="QUIZ"
status={
!isSubmitted && answer?.length === placeholder?.length
? "DEFAULT"
: "DISABLED"
answer?.length === placeholder?.length ? "DEFAULT" : "DISABLED"
}
content="답변 제출하기"
onClick={handleSubmit}
Expand Down

0 comments on commit 40fb08c

Please sign in to comment.