@@ -3,6 +3,7 @@ import { MoreVertical, X } from "lucide-react";
33import CardDetail from "./CardDetail" ;
44import CommentList from "./CommentList" ;
55import CardInput from "@/components/modalInput/CardInput" ;
6+ import { Representative } from "@/components/modalDashboard/Representative" ;
67import { useMutation , useQuery , useQueryClient } from "@tanstack/react-query" ;
78import { createComment } from "@/api/comment" ;
89import { deleteCard , EditCard } from "@/api/card" ;
@@ -95,78 +96,119 @@ export default function CardDetailPage({
9596
9697 return (
9798 < >
98- < div className = "fixed inset-0 bg-black/30 z-50 flex items-center justify-center px-4 sm:px-6" >
99+ { /* 모달 고정 div */ }
100+ < div
101+ className = "fixed inset-0 bg-black/30 z-50
102+ flex items-center justify-center px-4 sm:px-6"
103+ >
104+ { /* 모달 컨테이너 */ }
99105 < div
100- className = "
101- relative bg-white rounded-lg shadow-lg flex flex-col
102- w-[327px] h-[710px]
103- md:w-[678px] md:h-[766px]
104- lg:w-[730px] lg:h-[763px]
105- "
106+ className = "relative flex flex-col
107+ overflow-y-auto
108+ max-w-[730px] max-h-[calc(100vh-4rem)]
109+ lg:w-[730px] sm:w-[678px] w-[327px]
110+ bg-white rounded-lg shadow-lg"
106111 >
107- < div className = "flex justify-between items-center px-6 pt-6 pb-2" >
108- < h2 className = "font-24sb" > { cardData . title } </ h2 >
109- < div className = "flex items-center gap-3 relative" ref = { popupRef } >
110- < button
111- onClick = { ( ) => setShowMenu ( ( prev ) => ! prev ) }
112- className = "w-7 h-7 flex items-center justify-center hover:cursor-pointer"
113- title = "수정하기"
114- type = "button"
115- >
116- < MoreVertical className = "w-8 h-8 text-black cursor-pointer" />
117- </ button >
118- { showMenu && (
119- < div className = "absolute right-0 top-10 p-2 w-27 bg-white border border-[#D9D9D9] z-40 rounded-lg" >
112+ < div className = "flex items-center justify-center px-6 pt-6 pb-2" >
113+ { /* 내부 아이템 컨테이너 */ }
114+ < div className = "flex flex-col lg:w-[674px] sm:w-[614px] w-[295px]" >
115+ { /* 헤더 */ }
116+ < div className = "flex justify-between sm:mb-4 mb-2" >
117+ { /* 카드 제목 */ }
118+ < h2 className = "text-black3 font-bold sm:text-[24px] text-[20px]" >
119+ { cardData . title }
120+ </ h2 >
121+ { /* 버튼 컨테이너 */ }
122+ < div
123+ className = "relative flex items-center sm:gap-[24px] gap-[16px]"
124+ ref = { popupRef }
125+ >
126+ { /* 메뉴 버튼 */ }
120127 < button
121- className = "block w-full px-4 py-2 text-base text-gray-800 hover:bg-[#F1EFFD] hover:text-[#5534DA] rounded-sm cursor-pointer"
128+ onClick = { ( ) => setShowMenu ( ( prev ) => ! prev ) }
129+ className = "sm:w-[28px] sm:h-[28px] w-[20px] h-[20px]
130+ flex items-center justify-center hover:cursor-pointer"
131+ title = "수정하기"
122132 type = "button"
123- onClick = { ( ) => {
124- setIsEditModalOpen ( true ) ;
125- setShowMenu ( false ) ;
126- } }
127133 >
128- 수정하기
134+ < MoreVertical className = "w-8 h-8 text-black3 cursor-pointer" />
129135 </ button >
130- < button
131- className = "block w-full px-4 py-2 text-base text-gray-800 hover:bg-[#F1EFFD] hover:text-[#5534DA] rounded-sm cursor-pointer"
132- type = "button"
133- onClick = { ( ) => deleteCardMutate ( ) }
134- >
135- 삭제하기
136+ { showMenu && (
137+ < div
138+ className = "absolute right-0 top-9.5 p-2 z-40
139+ sm:w-28 w-20
140+ bg-white border border-[#D9D9D9] rounded-lg"
141+ >
142+ < button
143+ className = "w-full rounded-sm
144+ font-normal sm:text-[14px] text-[12px] text-black3
145+ hover:bg-[#F1EFFD] hover:text-[#5534DA]
146+ cursor-pointer"
147+ type = "button"
148+ onClick = { ( ) => {
149+ setIsEditModalOpen ( true ) ;
150+ setShowMenu ( false ) ;
151+ } }
152+ >
153+ 수정하기
154+ </ button >
155+ < button
156+ className = "w-full rounded-sm
157+ font-normal sm:text-[14px] text-[12px] text-black3
158+ hover:bg-[#F1EFFD] hover:text-[#5534DA]
159+ cursor-pointer"
160+ type = "button"
161+ onClick = { ( ) => deleteCardMutate ( ) }
162+ >
163+ 삭제하기
164+ </ button >
165+ </ div >
166+ ) }
167+ { /* 닫기 버튼 */ }
168+ < button onClick = { handleClose } title = "닫기" >
169+ < X
170+ className = "sm:w-[28px] sm:h-[28px] w-[20px] h-[20px]
171+ flex items-center justify-center hover:cursor-pointer"
172+ />
136173 </ button >
137174 </ div >
138- ) }
139- < button onClick = { handleClose } title = "닫기" >
140- < X className = "w-7 h-7 flex items-center justify-center hover:cursor-pointer" />
141- </ button >
142- </ div >
143- </ div >
175+ </ div >
144176
145- { /* 콘텐츠 (스크롤 없음) */ }
146- < div className = "px-6 pb-4 flex flex-col gap-6 flex-1 overflow-hidden" >
147- { /* 카드 상세 */ }
148- < CardDetail card = { cardData } columnName = { columnName } />
149-
150- { /* 댓글 입력 */ }
151- < div className = "w-full max-w-[450px]" >
152- < p className = "text-sm font-semibold mb-2" > 댓글</ p >
153- < CardInput
154- hasButton
155- small
156- value = { commentText }
157- onTextChange = { setCommentText }
158- onButtonClick = { handleCommentSubmit }
159- placeholder = "댓글 작성하기"
160- />
161- </ div >
177+ { /* 카드 내용 + 담당자 컨테이너 */ }
178+ < div className = "flex flex-col-reverse sm:flex-row gap-4" >
179+ < CardDetail card = { cardData } columnName = { columnName } />
180+ < div >
181+ < Representative card = { card } />
182+ </ div >
183+ </ div >
162184
163- { /* 댓글 리스트 (스크롤 가능) */ }
164- < div className = "w-full max-w-[450px] text-base max-h-[180px] overflow-y-auto scrollbar-hidden" >
165- < CommentList
166- cardId = { card . id }
167- currentUserId = { currentUserId }
168- teamId = { "" }
169- />
185+ { /* 댓글 입력창 */ }
186+ < div className = "mt-4 w-full lg:max-w-[445px] md:max-w-[420px]" >
187+ < p className = "mb-1 text-black3 font-medium sm:text-[16px] text-[14px]" >
188+ 댓글
189+ </ p >
190+ < CardInput
191+ hasButton
192+ small
193+ value = { commentText }
194+ onTextChange = { setCommentText }
195+ onButtonClick = { handleCommentSubmit }
196+ placeholder = "댓글 작성하기"
197+ />
198+ </ div >
199+
200+ { /* 댓글 목록 (스크롤 가능) */ }
201+ < div
202+ className = "w-full lg:max-w-[445px] md:max-w-[420px]
203+ sm:max-h-[140px] max-h-[70px]
204+ my-2 overflow-y-auto"
205+ >
206+ < CommentList
207+ cardId = { card . id }
208+ currentUserId = { currentUserId }
209+ teamId = { "" }
210+ />
211+ </ div >
170212 </ div >
171213 </ div >
172214 </ div >
0 commit comments