From 9f761849c2e98f650d089d00aed9df090497ada9 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 27 Oct 2025 03:12:26 +0000 Subject: (최겸) 공지사항 팝업기능 및 다시보지않기 기능 구현(로컬 스토리지 활용) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/notice/notice-client.tsx | 47 +++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) (limited to 'components/notice/notice-client.tsx') diff --git a/components/notice/notice-client.tsx b/components/notice/notice-client.tsx index 1eb6d75f..ae8ccebc 100644 --- a/components/notice/notice-client.tsx +++ b/components/notice/notice-client.tsx @@ -46,6 +46,7 @@ import { NoticeViewDialog } from "./notice-view-dialog" type NoticeWithAuthor = Notice & { authorName: string | null authorEmail: string | null + isPopup?: boolean } interface NoticeClientProps { @@ -150,10 +151,13 @@ export function NoticeClient({ initialData = [], currentUserId }: NoticeClientPr // 검색 필터 if (searchQuery.trim()) { const query = searchQuery.toLowerCase() - filtered = filtered.filter(notice => + filtered = filtered.filter(notice => notice.title.toLowerCase().includes(query) || notice.pagePath.toLowerCase().includes(query) || - notice.content.toLowerCase().includes(query) + notice.content.toLowerCase().includes(query) || + (notice.authorName && notice.authorName.toLowerCase().includes(query)) || + (notice.isPopup !== undefined && notice.isPopup ? '팝업' : '일반').toLowerCase().includes(query) || + (notice.dontShowDuration && notice.dontShowDuration.toLowerCase().includes(query)) ) } @@ -291,6 +295,9 @@ export function NoticeClient({ initialData = [], currentUserId }: NoticeClientPr )} + 팝업 + 게시기간 + {/* 다시보지않기 */} 작성자 상태 @@ -314,13 +321,13 @@ export function NoticeClient({ initialData = [], currentUserId }: NoticeClientPr {loading ? ( - + 로딩 중... ) : filteredAndSortedNotices.length === 0 ? ( - + {searchQuery.trim() ? "검색 결과가 없습니다." : "공지사항이 없습니다."} @@ -348,6 +355,38 @@ export function NoticeClient({ initialData = [], currentUserId }: NoticeClientPr + + + {notice.isPopup ? "팝업" : "일반"} + + + +
+ {notice.startAt && notice.endAt ? ( +
+
+ 시작: {formatDate(notice.startAt, "KR")} +
+
+ 종료: {formatDate(notice.endAt, "KR")} +
+
+ ) : ( + - + )} +
+
+ {/* +
+ {notice.dontShowDuration ? ( + + {notice.dontShowDuration === 'day' ? '하루' : '영구'} + + ) : ( + - + )} +
+
*/}
-- cgit v1.2.3