11import { useMemo , useRef , useState } from "react" ;
2+ import clsx from "clsx" ;
23import { MoreVertical , X } from "lucide-react" ;
34import CardDetail from "./CardDetail" ;
45import CommentList from "./CommentList" ;
5- import CardInput from "@/components/modalInput/CardInput" ;
6+ import CommentInput from "@/components/modalInput/CardInput" ;
67import { Representative } from "@/components/modalDashboard/Representative" ;
78import { useMutation , useQuery , useQueryClient } from "@tanstack/react-query" ;
89import { createComment } from "@/api/comment" ;
@@ -106,18 +107,38 @@ export default function CardDetailPage({
106107
107108 return (
108109 < >
109- < div className = "fixed inset-0 bg-black/35 z-50 flex items-center justify-center px-4 sm:px-6" >
110- < div className = "relative flex flex-col overflow-y-auto max-w-[730px] max-h-[calc(100vh-4rem)] lg:w-[730px] sm:w-[678px] w-[327px] bg-white rounded-lg shadow-lg" >
110+ { /* 모달 고정 div */ }
111+ < div
112+ className = { clsx (
113+ "fixed inset-0 z-50" ,
114+ "flex items-center justify-center px-4 sm:px-6" ,
115+ "bg-black/35"
116+ ) }
117+ >
118+ { /* 모달창 */ }
119+ < div
120+ className = { clsx (
121+ "relative flex flex-col overflow-y-auto" ,
122+ "lg:w-[730px] sm:w-[678px] w-[327px]" ,
123+ "max-w-[730px] max-h-[calc(100vh-6rem)]" ,
124+ "bg-white rounded-lg shadow-lg"
125+ ) }
126+ >
111127 < div className = "flex items-center justify-center px-6 pt-6 pb-2" >
128+ { /* 내부 아이템 컨테이너 */ }
112129 < div className = "flex flex-col lg:w-[674px] sm:w-[614px] w-[295px]" >
130+ { /* 헤더 컨테이너 */ }
113131 < div className = "flex justify-between sm:mb-4 mb-2" >
132+ { /* 제목 */ }
114133 < h2 className = "text-black3 font-bold sm:text-[20px] text-[16px]" >
115134 { cardData . title }
116135 </ h2 >
136+ { /* 버튼 컨테이너 */ }
117137 < div
118138 className = "relative flex items-center sm:gap-[24px] gap-[16px]"
119139 ref = { popupRef }
120140 >
141+ { /* 메뉴 버튼 */ }
121142 < button
122143 onClick = { ( ) => setShowMenu ( ( prev ) => ! prev ) }
123144 className = "sm:w-[28px] sm:h-[28px] w-[20px] h-[20px] flex items-center justify-center hover:cursor-pointer"
@@ -126,6 +147,7 @@ export default function CardDetailPage({
126147 >
127148 < MoreVertical className = "w-8 h-8 text-black3 cursor-pointer" />
128149 </ button >
150+ { /* 수정/삭제 드롭다운 메뉴 */ }
129151 { showMenu && (
130152 < div className = "absolute right-0 top-9.5 p-2 z-40 flex flex-col items-center justify-center sm:gap-[6px] gap-[11px] sm:w-28 w-20 sm:h-24 bg-white border border-[#D9D9D9] rounded-lg" >
131153 < button
@@ -153,18 +175,20 @@ export default function CardDetailPage({
153175 </ div >
154176 </ div >
155177
178+ { /* 카드 내용 */ }
156179 < div className = "flex flex-col-reverse sm:flex-row gap-4" >
157180 < CardDetail card = { cardData } columnName = { columnName } />
158181 < div >
159182 < Representative card = { cardData } />
160183 </ div >
161184 </ div >
162185
186+ { /* 댓글 */ }
163187 < div className = "mt-4 w-full lg:max-w-[445px] md:max-w-[420px]" >
164188 < p className = "mb-1 text-black3 font-medium sm:text-[16px] text-[14px]" >
165189 댓글
166190 </ p >
167- < CardInput
191+ < CommentInput
168192 hasButton
169193 value = { commentText }
170194 onTextChange = { setCommentText }
0 commit comments