From f54951081e97e6d8a1d72d7d1d23fbed76a9e6bb Mon Sep 17 00:00:00 2001 From: YeoEunnn Date: Mon, 19 Jan 2026 22:04:39 +0900 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20gemini=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EC=88=98=EC=A0=95=20(#56)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/CardView.tsx | 6 +++--- src/components/common/FileDropzone.tsx | 2 +- src/components/common/ListView.tsx | 14 -------------- src/components/projects/ProjectHeader.tsx | 10 ++++++++-- src/hooks/useProjectList.ts | 6 +++--- 5 files changed, 15 insertions(+), 23 deletions(-) diff --git a/src/components/common/CardView.tsx b/src/components/common/CardView.tsx index 304ed74a..e7053cbf 100644 --- a/src/components/common/CardView.tsx +++ b/src/components/common/CardView.tsx @@ -9,7 +9,7 @@ export interface CardViewProps { className?: string; itemClassName?: string; empty?: ReactNode; - ariaLabal?: string; + ariaLabel?: string; } export function CardView({ @@ -19,14 +19,14 @@ export function CardView({ className, itemClassName, empty, - ariaLabal, + ariaLabel, }: CardViewProps) { if (items.length === 0) { return
{empty ?? 'No items'}
; } return ( -
+
{items.map((item, index) => (
-
+
diff --git a/src/components/common/ListView.tsx b/src/components/common/ListView.tsx index 7880a712..d8b39290 100644 --- a/src/components/common/ListView.tsx +++ b/src/components/common/ListView.tsx @@ -60,20 +60,6 @@ export function ListView({ > {renderLeading &&
{renderLeading(item)}
} - {/*
-
{renderTitle(item)}
- - {(renderUpdatedAt || renderMeta) && ( -
- {renderUpdatedAt && ( - {renderUpdatedAt(item)} - )} - {renderMeta && {renderMeta(item)}} -
- )} - - {renderStats &&
{renderStats(item)}
} -
*/}
{renderInfo(item)}
{renderTrailing && ( diff --git a/src/components/projects/ProjectHeader.tsx b/src/components/projects/ProjectHeader.tsx index 1c62d9b1..b01f023e 100644 --- a/src/components/projects/ProjectHeader.tsx +++ b/src/components/projects/ProjectHeader.tsx @@ -94,7 +94,10 @@ export default function ProjectHeader({ - -
- + <> +
+
+ {thumbnailUrl && ( + {title} + )}
-

{updatedAt}

-
-
- - {pageCount} 페이지 +
+ {/* 제목 및 업데이트 날짜 */} +
+

{title}

+ ( + + )} + position="bottom" + align="end" + ariaLabel="더보기" + className="border border-gray-200 w-32 overflow-hidden" + > + {({ close }) => ( +
+ + +
+ )} +
+

{updatedAt}

- {/* 반응 모음 */} -
-
- - {commentCount} -
+
- - {reactionCount} + + {pageCount} 페이지
-
- - {viewCount} + + {/* 반응 모음 */} +
+
+ + {commentCount} +
+
+ + {reactionCount} +
+
+ + {viewCount} +
-
-
+ + + setIsDeleteModalOpen(false)} + title="발표 삭제" + size="sm" + > +
+

{title}

+

해당 발표를 정말 삭제하시겠습니까?

+
+
+ + +
+
+ ); } diff --git a/src/components/projects/ProjectList.tsx b/src/components/projects/ProjectList.tsx index ceba323f..6bb59d0f 100644 --- a/src/components/projects/ProjectList.tsx +++ b/src/components/projects/ProjectList.tsx @@ -67,7 +67,7 @@ export default function ProjectList({ items, className, itemClassName }: Project
)} - renderTrailing={(item) => ( + renderTrailing={() => ( ( From 4e38b45aecdac7565d20ea7f79385d6ca1909db0 Mon Sep 17 00:00:00 2001 From: YeoEunnn Date: Mon, 19 Jan 2026 22:58:19 +0900 Subject: [PATCH 3/4] =?UTF-8?q?refactor:=20=EC=B9=B4=EB=93=9C=EB=B7=B0,=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=EB=B7=B0=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=20=ED=86=B5=EC=9D=BC=20(#56)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/CardView.tsx | 2 ++ src/components/common/ListView.tsx | 50 +++++++++--------------------- 2 files changed, 17 insertions(+), 35 deletions(-) diff --git a/src/components/common/CardView.tsx b/src/components/common/CardView.tsx index e7053cbf..36235dfe 100644 --- a/src/components/common/CardView.tsx +++ b/src/components/common/CardView.tsx @@ -5,7 +5,9 @@ import clsx from 'clsx'; export interface CardViewProps { items: readonly T[]; getKey: (item: T, index: number) => Key; + renderCard: (item: T) => ReactNode; + className?: string; itemClassName?: string; empty?: ReactNode; diff --git a/src/components/common/ListView.tsx b/src/components/common/ListView.tsx index d8b39290..a746aa56 100644 --- a/src/components/common/ListView.tsx +++ b/src/components/common/ListView.tsx @@ -10,7 +10,6 @@ export interface ListViewProps { renderTrailing?: (item: T) => ReactNode; renderInfo: (item: T) => ReactNode; - onItemClick?: (item: T) => void; className?: string; itemClassName?: string; empty?: ReactNode; @@ -23,7 +22,6 @@ export function ListView({ renderLeading, renderTrailing, renderInfo, - onItemClick, className, itemClassName, empty, @@ -33,41 +31,23 @@ export function ListView({ return
{empty ?? 'No items'}
; } - const isClickable = Boolean(onItemClick); - return (
- {items.map((item, index) => { - const key = getKey(item, index); - - return ( -
onItemClick?.(item) : undefined} - onKeyDown={ - isClickable - ? (e) => { - if (e.key === 'Enter' || e.key === ' ') { - e.preventDefault(); - onItemClick?.(item); - } - } - : undefined - } - > - {renderLeading &&
{renderLeading(item)}
} - -
{renderInfo(item)}
- - {renderTrailing && ( -
{renderTrailing(item)}
- )} -
- ); - })} + {items.map((item, index) => ( +
+ {renderLeading &&
{renderLeading(item)}
} + +
{renderInfo(item)}
+ + {renderTrailing && ( +
{renderTrailing(item)}
+ )} +
+ ))}
); } From ef18b03c493aca94802b919805ee40b4d6ba8814 Mon Sep 17 00:00:00 2001 From: YeoEunnn Date: Tue, 20 Jan 2026 02:20:02 +0900 Subject: [PATCH 4/4] =?UTF-8?q?refactor:=20=EC=82=AD=EC=A0=9C=20=EB=AA=A8?= =?UTF-8?q?=EB=8B=AC=EC=9D=84=20PjSection=EC=97=90=EC=84=9C=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95=20(#5?= =?UTF-8?q?6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/home/ProjectsSection.tsx | 45 ++++++- src/components/projects/ProjectCard.tsx | 171 +++++++++--------------- src/components/projects/ProjectList.tsx | 48 ++++--- 3 files changed, 137 insertions(+), 127 deletions(-) diff --git a/src/components/home/ProjectsSection.tsx b/src/components/home/ProjectsSection.tsx index 768be1f5..ecbca130 100644 --- a/src/components/home/ProjectsSection.tsx +++ b/src/components/home/ProjectsSection.tsx @@ -1,7 +1,9 @@ +import { useState } from 'react'; + import type { ViewMode } from '@/types/home'; import type { ProjectItem } from '@/types/project'; -import { CardView, ListView } from '../common'; +import { CardView, Modal } from '../common'; import ProjectCard from '../projects/ProjectCard'; import { ProjectCardSkeleton } from '../projects/ProjectCardSkeleton'; import ProjectHeader from '../projects/ProjectHeader'; @@ -28,6 +30,7 @@ export default function ProjectsSection({ onChangeViewMode, }: Props) { const hasProjects = projects.length > 0; + const [deleteTarget, setDeleteTarget] = useState(null); if (!isLoading && !hasProjects) return null; @@ -58,7 +61,9 @@ export default function ProjectsSection({ items={projects} getKey={(item) => item.id} className="mt-6 grid grid-cols-2 gap-4 lg:grid-cols-3" - renderCard={(item) => } + renderCard={(item) => ( + setDeleteTarget(target)} /> + )} /> ) ) : isLoading ? ( @@ -71,9 +76,41 @@ export default function ProjectsSection({ ))}
) : ( - + )} - {/* 프레젠테이션 목록 */} + + setDeleteTarget(null)} + title="발표 삭제" + size="sm" + > +
+

{deleteTarget?.title}

+

해당 발표를 정말 삭제하시겠습니까?

+
+ +
+ + +
+
); } diff --git a/src/components/projects/ProjectCard.tsx b/src/components/projects/ProjectCard.tsx index a4075d86..fad9ad58 100644 --- a/src/components/projects/ProjectCard.tsx +++ b/src/components/projects/ProjectCard.tsx @@ -1,5 +1,3 @@ -import { useState } from 'react'; - import clsx from 'clsx'; import CommentCountIcon from '@/assets/icons/icon-comment-count.svg?react'; @@ -9,127 +7,84 @@ import ReactionCountIcon from '@/assets/icons/icon-reaction-count.svg?react'; import ViewCountIcon from '@/assets/icons/icon-view-count.svg?react'; import type { ProjectItem } from '@/types/project'; -import { Modal, Popover } from '../common'; +import { Popover } from '../common'; type ProjectCardProps = { item: ProjectItem; className?: string; + onDeleteClick?: (item: ProjectItem) => void; // 상위로 올릴 콜백 (플젝 삭제) }; -export default function ProjectCard({ item, className }: ProjectCardProps) { - const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false); - - const { - title, - updatedAt, - pageCount, - commentCount, - reactionCount, - viewCount = 0, - thumbnailUrl, - } = item; +export default function ProjectCard({ item, className, onDeleteClick }: ProjectCardProps) { + const { title, updatedAt, pageCount, commentCount, reactionCount, viewCount, thumbnailUrl } = + item; return ( - <> -
-
- {thumbnailUrl && ( - {title} - )} +
+
+ {thumbnailUrl && ( + {title} + )} +
+ +
+ {/* 제목 및 업데이트 날짜 */} +
+

{title}

+ ( + + )} + position="bottom" + align="end" + ariaLabel="더보기" + className="border border-gray-200 w-32 overflow-hidden" + > + {({ close }) => ( +
+ + +
+ )} +
-
- {/* 제목 및 업데이트 날짜 */} -
-

{title}

- ( - - )} - position="bottom" - align="end" - ariaLabel="더보기" - className="border border-gray-200 w-32 overflow-hidden" - > - {({ close }) => ( -
- - -
- )} -
+

{updatedAt}

+ +
+
+ + {pageCount} 페이지
-

{updatedAt}

-
-
- - {pageCount} 페이지 + {/* 반응 모음 */} +
+
+ + {commentCount}
- - {/* 반응 모음 */} -
-
- - {commentCount} -
-
- - {reactionCount} -
-
- - {viewCount} -
+
+ + {reactionCount} +
+
+ + {viewCount}
-
- - setIsDeleteModalOpen(false)} - title="발표 삭제" - size="sm" - > -
-

{title}

-

해당 발표를 정말 삭제하시겠습니까?

-
-
- - -
-
- +
+
); } diff --git a/src/components/projects/ProjectList.tsx b/src/components/projects/ProjectList.tsx index 6bb59d0f..e31b51a1 100644 --- a/src/components/projects/ProjectList.tsx +++ b/src/components/projects/ProjectList.tsx @@ -13,9 +13,15 @@ type ProjectListProps = { items: ProjectItem[]; className?: string; itemClassName?: string; + onDeleteClick?: (item: ProjectItem) => void; // 상위로 올릴 콜백 (플젝 삭제) }; -export default function ProjectList({ items, className, itemClassName }: ProjectListProps) { +export default function ProjectList({ + items, + className, + itemClassName, + onDeleteClick, +}: ProjectListProps) { return ( -
+
{item.updatedAt} | @@ -67,27 +73,39 @@ export default function ProjectList({ items, className, itemClassName }: Project
)} - renderTrailing={() => ( + renderTrailing={(item) => ( ( - + )} position="bottom" align="end" ariaLabel="더보기" className="border border-gray-200 w-32 overflow-hidden" > -
- - -
+ {({ close }) => ( +
+ + +
+ )}
)} />