From 086b043f65260fedf565cc9b994abf62ae9d0c84 Mon Sep 17 00:00:00 2001 From: mihee Date: Wed, 22 Nov 2023 22:45:23 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20ShortReviewModal=20props=20?= =?UTF-8?q?=EB=B0=8F=20=EC=9E=85=EB=8D=95=ED=8F=AC=EC=9D=B8=ED=8A=B8=20pro?= =?UTF-8?q?perty=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD=20#303?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReviewRating/ShortReviewModal.tsx | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/features/reviews/components/ReviewRating/ShortReviewModal.tsx b/src/features/reviews/components/ReviewRating/ShortReviewModal.tsx index 9a8843dc..c78176b6 100644 --- a/src/features/reviews/components/ReviewRating/ShortReviewModal.tsx +++ b/src/features/reviews/components/ReviewRating/ShortReviewModal.tsx @@ -3,6 +3,7 @@ import { PropsWithChildren } from "react"; import Modal from "@/components/Modal"; import Textarea from "@/components/TextArea"; +import { ReviewInfo } from "../../api/review"; import useReviewForm from "../../hook/useReviewForm"; import AttractionPoint from "../AttractionPoint"; @@ -15,23 +16,16 @@ import { } from "./ShortReviewModal.style"; import SpoilerCheckBox from "./SpoilerCheckBox"; -export interface MOCK_USER_REVIEW_DATA { - reviewId: number; - animeId: number; - content: string; - isSpoiler: boolean; - character: boolean; - art: boolean; - story: boolean; - voiceActing: boolean; - sound: boolean; -} +export type UserReview = Pick< + ReviewInfo, + "reviewId" | "animeId" | "content" | "isSpoiler" +>; interface ShortReviewModalProps { onClose: () => void; onReview: () => void; showBackdrop?: boolean; - userReviewData?: MOCK_USER_REVIEW_DATA; + userReviewData?: UserReview; } export default function ShortReviewModal({ @@ -67,7 +61,7 @@ export default function ShortReviewModal({ 그림체 ), - isChecked: form.art, + isChecked: form.drawing, }, { name: "story", @@ -86,7 +80,7 @@ export default function ShortReviewModal({ 성우들의 미친 연기력 ), - isChecked: form.voiceActing, + isChecked: form.voiceActor, }, { name: "sound", @@ -95,7 +89,7 @@ export default function ShortReviewModal({ 가슴이 옹졸해지는 음악 ), - isChecked: form.sound, + isChecked: form.music, }, ];