From 6b40eeddfc0f4c439ab13a5b49648574237f1f41 Mon Sep 17 00:00:00 2001 From: MyungJiwoo <1206jiwoo@gmail.com> Date: Mon, 4 Aug 2025 14:05:47 +0900 Subject: [PATCH 1/6] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20[#239]=20Refactor:=20?= =?UTF-8?q?=EC=98=88=EC=95=BD=20=EB=82=B4=EC=97=AD=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=EB=A1=9C=20=EC=9D=B4=EB=8F=99=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EC=98=81=EC=97=AD=EC=9D=84=20=EC=95=8C=EB=A6=BC=20=EC=B9=B4?= =?UTF-8?q?=EB=93=9C=20=EC=98=81=EC=97=AD=20=EC=A0=84=EC=B2=B4=EB=A1=9C=20?= =?UTF-8?q?=ED=99=95=EB=8C=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/NotificationCard.tsx | 41 +++++++++++++------ 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/packages/design-system/src/components/NotificationCard.tsx b/packages/design-system/src/components/NotificationCard.tsx index 94a401c7..d1e1d15d 100644 --- a/packages/design-system/src/components/NotificationCard.tsx +++ b/packages/design-system/src/components/NotificationCard.tsx @@ -60,6 +60,10 @@ const parseNotificationContent = (content: string): ParsedNotification | null => export default function NotificationCard({ content, onDelete, onClickDetail }: NotificationCardProps) { const parsedNotification = parseNotificationContent(content); + const handleClickStop = (e: React.MouseEvent) => { + e.stopPropagation(); + }; + // parsedNotification 실패시 기본 content를 메시지로 보여줍니다. if (!parsedNotification) { return ( @@ -78,7 +82,13 @@ export default function NotificationCard({ content, onDelete, onClickDetail }: N const { title, date, confirm } = parsedNotification; return ( -
+
{ + handleClickStop(e); + onClickDetail(); + }} + >
{confirm ? : } @@ -86,21 +96,26 @@ export default function NotificationCard({ content, onDelete, onClickDetail }: N {confirm ? '예약이 승인되었어요!' : '예약이 거절되었어요.'}
-
-
-
- -

{title}

-
-
- -

- {date.year}년 {date.month}월 {date.day}일 {date.startTime}~{date.endTime} -

-
+
+ +

{title}

+
+
+ +

+ {date.year}년 {date.month}월 {date.day}일 {date.startTime}~{date.endTime} +

); From 2895765d48b33158109b1007a311b94a1298b9e6 Mon Sep 17 00:00:00 2001 From: MyungJiwoo <1206jiwoo@gmail.com> Date: Mon, 4 Aug 2025 14:32:33 +0900 Subject: [PATCH 2/6] =?UTF-8?q?=E2=9C=A8=20[#239]=20Feat:=20NotificationCa?= =?UTF-8?q?rd=EC=9D=98=20=EC=8A=A4=EC=BC=88=EB=A0=88=ED=86=A4=20UI=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skeleton/NotificationCardSkeleton.tsx | 26 +++++++++++++++++++ .../src/components/skeleton/index.tsx | 1 + .../src/pages/NotificationCardDoc.tsx | 2 ++ 3 files changed, 29 insertions(+) create mode 100644 packages/design-system/src/components/skeleton/NotificationCardSkeleton.tsx diff --git a/packages/design-system/src/components/skeleton/NotificationCardSkeleton.tsx b/packages/design-system/src/components/skeleton/NotificationCardSkeleton.tsx new file mode 100644 index 00000000..3c247ab8 --- /dev/null +++ b/packages/design-system/src/components/skeleton/NotificationCardSkeleton.tsx @@ -0,0 +1,26 @@ +export default function NotificationCardSkeleton() { + return ( +
+ {/* 상단: 상태 뱃지 + 문구 + 삭제 버튼 */} +
+
+
+
+
+
+
+ + {/* 제목 (아이콘 + 텍스트) */} +
+
+
+
+ + {/* 날짜 및 시간 (아이콘 + 텍스트) */} +
+
+
+
+
+ ); +} diff --git a/packages/design-system/src/components/skeleton/index.tsx b/packages/design-system/src/components/skeleton/index.tsx index cb65c034..015d3644 100644 --- a/packages/design-system/src/components/skeleton/index.tsx +++ b/packages/design-system/src/components/skeleton/index.tsx @@ -1 +1,2 @@ export { default as ExperienceCardSkeleton } from './ExperienceCardSkeleton'; +export { default as NotificationCardSkeleton } from './NotificationCardSkeleton'; diff --git a/packages/design-system/src/pages/NotificationCardDoc.tsx b/packages/design-system/src/pages/NotificationCardDoc.tsx index 3cb15e7e..c4acf1b7 100644 --- a/packages/design-system/src/pages/NotificationCardDoc.tsx +++ b/packages/design-system/src/pages/NotificationCardDoc.tsx @@ -1,5 +1,6 @@ import { useNavigate } from 'react-router-dom'; +import { NotificationCardSkeleton } from '@/components'; import Playground from '@/layouts/Playground'; import NotificationCard from '../components/NotificationCard'; @@ -55,6 +56,7 @@ Header의 알림창 팝오버에서 보여지며, 알림은 개별 삭제 가능 onClickDetail={() => navigate('/mypage/reservations-list')} onDelete={() => alert('삭제 API 요청')} /> + navigate('/mypage/reservations-list')} From ba301f512b9537f5e9541447719be205ff52f99c Mon Sep 17 00:00:00 2001 From: MyungJiwoo <1206jiwoo@gmail.com> Date: Mon, 4 Aug 2025 14:33:01 +0900 Subject: [PATCH 3/6] =?UTF-8?q?=E2=9C=A8=20[#239]=20Feat:=20=EC=95=8C?= =?UTF-8?q?=EB=A6=BC=20=ED=8C=9D=EC=98=A4=EB=B2=84=20=EB=82=B4=EC=97=90=20?= =?UTF-8?q?=EC=8A=A4=EC=BC=88=EB=A0=88=ED=86=A4=20UI=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../notification/NotificationPopover.tsx | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/apps/what-today/src/components/notification/NotificationPopover.tsx b/apps/what-today/src/components/notification/NotificationPopover.tsx index db5602a4..48102030 100644 --- a/apps/what-today/src/components/notification/NotificationPopover.tsx +++ b/apps/what-today/src/components/notification/NotificationPopover.tsx @@ -1,5 +1,13 @@ import { useInfiniteQuery, useMutation, useQueryClient } from '@tanstack/react-query'; -import { BellIcon, Button, DotIcon, NotificationCard, Popover, useToast } from '@what-today/design-system'; +import { + BellIcon, + Button, + DotIcon, + NotificationCard, + NotificationCardSkeleton, + Popover, + useToast, +} from '@what-today/design-system'; import type { AxiosError } from 'axios'; import { useRef, useState } from 'react'; import { useNavigate } from 'react-router-dom'; @@ -31,7 +39,7 @@ export default function NotificationPopover({ isMobile }: NotificationPopoverPro */ const fetchNotifications = async ({ cursorId }: { cursorId: number | null }): Promise => { const params = { - size: 10, + size: 3, cursorId: cursorId || null, }; @@ -129,10 +137,17 @@ export default function NotificationPopover({ isMobile }: NotificationPopoverPro -

알림 {data?.pages[0].totalCount}개

+

알림 {data?.pages[0].totalCount ?? 0}개

-
- {isLoading &&

Loading...

} +
+ {isLoading && ( + <> + + + + + + )}
{data?.pages.map((page) => page.notifications.map((notification) => ( @@ -152,7 +167,8 @@ export default function NotificationPopover({ isMobile }: NotificationPopoverPro

알림이 없습니다.

)}
{/* 무한 스크롤 감지용 */} -
+ {isFetchingNextPage && } +
); From a33ddd7f8c1b9bdc053db2928be62655332c0b07 Mon Sep 17 00:00:00 2001 From: MyungJiwoo <1206jiwoo@gmail.com> Date: Mon, 4 Aug 2025 14:35:38 +0900 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=90=9B=20[#239]=20Fix:=20=EC=95=8C?= =?UTF-8?q?=EB=A6=BC=20=EB=AC=B4=ED=95=9C=EC=8A=A4=ED=81=AC=EB=A1=A4=20?= =?UTF-8?q?=EC=9A=94=EC=B2=AD=20size=20=EC=9B=90=EC=83=81=EB=B3=B5?= =?UTF-8?q?=EA=B5=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/notification/NotificationPopover.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/what-today/src/components/notification/NotificationPopover.tsx b/apps/what-today/src/components/notification/NotificationPopover.tsx index 48102030..b7d84fc9 100644 --- a/apps/what-today/src/components/notification/NotificationPopover.tsx +++ b/apps/what-today/src/components/notification/NotificationPopover.tsx @@ -39,7 +39,7 @@ export default function NotificationPopover({ isMobile }: NotificationPopoverPro */ const fetchNotifications = async ({ cursorId }: { cursorId: number | null }): Promise => { const params = { - size: 3, + size: 10, cursorId: cursorId || null, }; From c1d21ab66eee08d5ee2f79a65638ee98969b5b80 Mon Sep 17 00:00:00 2001 From: MyungJiwoo <1206jiwoo@gmail.com> Date: Mon, 4 Aug 2025 14:43:12 +0900 Subject: [PATCH 5/6] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20[#239]=20Refactor:=20U?= =?UTF-8?q?I=20=EC=9D=BC=EA=B4=80=EC=84=B1=20=EB=A6=AC=ED=8C=A9=ED=86=A0?= =?UTF-8?q?=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design-system/src/components/NotificationCard.tsx | 8 ++++---- .../src/components/skeleton/NotificationCardSkeleton.tsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/design-system/src/components/NotificationCard.tsx b/packages/design-system/src/components/NotificationCard.tsx index d1e1d15d..2eb13524 100644 --- a/packages/design-system/src/components/NotificationCard.tsx +++ b/packages/design-system/src/components/NotificationCard.tsx @@ -83,7 +83,7 @@ export default function NotificationCard({ content, onDelete, onClickDetail }: N return (
{ handleClickStop(e); onClickDetail(); @@ -92,7 +92,7 @@ export default function NotificationCard({ content, onDelete, onClickDetail }: N
{confirm ? : } -

+

{confirm ? '예약이 승인되었어요!' : '예약이 거절되었어요.'}

@@ -107,11 +107,11 @@ export default function NotificationCard({ content, onDelete, onClickDetail }: N
-
+

{title}

-
+

{date.year}년 {date.month}월 {date.day}일 {date.startTime}~{date.endTime} diff --git a/packages/design-system/src/components/skeleton/NotificationCardSkeleton.tsx b/packages/design-system/src/components/skeleton/NotificationCardSkeleton.tsx index 3c247ab8..999754c2 100644 --- a/packages/design-system/src/components/skeleton/NotificationCardSkeleton.tsx +++ b/packages/design-system/src/components/skeleton/NotificationCardSkeleton.tsx @@ -1,6 +1,6 @@ export default function NotificationCardSkeleton() { return ( -

+
{/* 상단: 상태 뱃지 + 문구 + 삭제 버튼 */}
From c221c6852099243278e68dc8e9e8cc01ec39e286 Mon Sep 17 00:00:00 2001 From: MyungJiwoo <1206jiwoo@gmail.com> Date: Mon, 4 Aug 2025 18:30:29 +0900 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=90=9B=20[#239]=20Fix:=20text-gray-95?= =?UTF-8?q?0=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/design-system/src/components/NotificationCard.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/design-system/src/components/NotificationCard.tsx b/packages/design-system/src/components/NotificationCard.tsx index 2eb13524..272997de 100644 --- a/packages/design-system/src/components/NotificationCard.tsx +++ b/packages/design-system/src/components/NotificationCard.tsx @@ -69,7 +69,7 @@ export default function NotificationCard({ content, onDelete, onClickDetail }: N return (
-

알림

+

알림

@@ -92,9 +92,7 @@ export default function NotificationCard({ content, onDelete, onClickDetail }: N
{confirm ? : } -

- {confirm ? '예약이 승인되었어요!' : '예약이 거절되었어요.'} -

+

{confirm ? '예약이 승인되었어요!' : '예약이 거절되었어요.'}