@@ -13,66 +13,101 @@ export default function Notifications() {
1313 // const queryClient = useQueryClient();
1414 // const router = useRouter();
1515 return (
16- < div className = "min-h-screen bg-background" >
17- < main className = "max-w-4xl mx-auto px-6 py-8" >
18- < div className = "flex items-center gap-3 mb-8" >
19- < Bell className = "text-accent" size = { 28 } />
20- < h1 className = "text-2xl font-bold text-foreground" > 알림</ h1 >
21- </ div >
16+ < div className = "flex flex-col px-10 py-18 w-full gap-4 justify-center items-center" >
17+ < div className = "flex flex-col max-w-[1600px] w-full gap-6" >
18+ { /* 헤더 섹션 */ }
19+ < section >
20+ < h1 className = "text-3xl font-bold mb-2 text-secondary" > 알림</ h1 >
21+ < p className = "text-gray-400" > 새로운 알림과 업데이트를 확인하세요</ p >
22+ </ section >
2223
23- { /* 알림 목록 */ }
24- < div className = "space-y-4" >
25- { notifications . content . map ( ( notification ) => {
26- return (
27- < div
28- key = { notification . id }
29- className = { `bg-card border-border rounded-[10px] p-6 shadow-subtle hover:shadow-hover transition-all duration-200 cursor-pointer ${
30- ! notification . isRead
31- ? 'border-[2px] border-[#214d35]'
32- : 'border-[1px] border-[#2a2a2a]'
33- } `}
34- onClick = { async ( ) => {
35- const result = await readNotification ( notification . id ) ;
36- console . log ( result ) ;
37- // router.push(notification.redirectUrl);
38- } }
39- >
40- < div className = "flex items-start gap-4" >
41- < div className = "flex flex-row gap-4 items-center w-full" >
42- { ! notification . isRead && (
43- < div
44- className = { `w-2 h-2 rounded-full mt-2 ${
45- notification . isRead ? 'bg-gray-500' : 'bg-primary'
46- } `}
47- />
48- ) }
49- < div className = "flex-1 min-w-0 justify-between flex-ronsmw " >
50- < p className = "text-muted-foreground text-sm leading-relaxed mb-3" >
51- { notification . message }
52- </ p >
24+ { /* 알림 목록 섹션 */ }
25+ < section className = "bg-gray-900/50 rounded-[10px] border border-gray-800 overflow-hidden" >
26+ { /* 알림 헤더 */ }
27+ < div className = "border-b border-gray-800 bg-gray-800/50 p-6" >
28+ < div className = "flex items-center gap-3" >
29+ < Bell className = "text-[#00d084]" size = { 24 } />
30+ < h2 className = "text-lg font-semibold text-white" > 전체 알림</ h2 >
31+ { notifications . content . filter ( ( n ) => ! n . isRead ) . length > 0 && (
32+ < span className = "bg-[#00d084] text-white px-2 py-1 rounded-full text-xs font-medium" >
33+ { notifications . content . filter ( ( n ) => ! n . isRead ) . length } 개의 새 알림
34+ </ span >
35+ ) }
36+ </ div >
37+ </ div >
5338
54- < div className = "flex items-center justify-between text-xs" >
55- < span className = "text-muted" > { notification . createdAt } </ span >
56- { ! notification . isRead && (
57- < span className = "text-[#FFF] font-medium" > 새 알림</ span >
58- ) }
59- </ div >
60- </ div >
61- </ div >
39+ { /* 알림 목록 */ }
40+ < div className = "divide-y divide-gray-800" >
41+ { notifications . content . length === 0 ? (
42+ < div className = "text-center py-16" >
43+ < div className = "bg-[#00d084]/10 w-20 h-20 rounded-full flex items-center justify-center mx-auto mb-4" >
44+ < Bell className = "text-[#00d084]" size = { 32 } />
6245 </ div >
46+ < h3 className = "text-lg font-medium text-white mb-2" > 알림이 없습니다</ h3 >
47+ < p className = "text-gray-400" > 새로운 알림이 도착하면 여기에 표시됩니다.</ p >
6348 </ div >
64- ) ;
65- } ) }
66- </ div >
49+ ) : (
50+ notifications . content . map ( ( notification ) => {
51+ return (
52+ < div
53+ key = { notification . id }
54+ className = { `p-6 hover:bg-white/[0.08] transition-colors duration-200 cursor-pointer ${
55+ ! notification . isRead ? 'bg-[#00d084]/5 border-l-4 border-l-[#00d084]' : ''
56+ } `}
57+ onClick = { async ( ) => {
58+ const result = await readNotification ( notification . id ) ;
59+ console . log ( result ) ;
60+ // router.push(notification.redirectUrl);
61+ } }
62+ >
63+ < div className = "flex items-start gap-4" >
64+ { /* 읽음/안읽음 인디케이터 */ }
65+ < div className = "flex-shrink-0 mt-1" >
66+ < div
67+ className = { `w-3 h-3 rounded-full ${
68+ notification . isRead ? 'bg-gray-600' : 'bg-[#00d084] animate-pulse'
69+ } `}
70+ />
71+ </ div >
6772
68- { notifications . content . length === 0 && (
69- < div className = "text-center py-12" >
70- < Bell className = "mx-auto text-muted-foreground mb-4" size = { 48 } />
71- < h3 className = "text-lg font-medium text-foreground mb-2" > 알림이 없습니다</ h3 >
72- < p className = "text-muted-foreground" > 새로운 알림이 도착하면 여기에 표시됩니다.</ p >
73+ { /* 알림 내용 */ }
74+ < div className = "flex-1 min-w-0" >
75+ < p
76+ className = { `text-sm leading-relaxed mb-3 ${
77+ notification . isRead ? 'text-gray-400' : 'text-white font-medium'
78+ } `}
79+ >
80+ { notification . message }
81+ </ p >
82+
83+ < div className = "flex items-center justify-between" >
84+ < span className = "text-xs text-gray-500" >
85+ { notification . createdAt . split ( 'T' ) [ 0 ] }
86+ </ span >
87+ { ! notification . isRead && (
88+ < span className = "bg-[#00d084] text-white px-2 py-1 rounded-full text-xs font-medium" >
89+ NEW
90+ </ span >
91+ ) }
92+ </ div >
93+ </ div >
94+ </ div >
95+ </ div >
96+ ) ;
97+ } )
98+ ) }
7399 </ div >
74- ) }
75- </ main >
100+ { notifications . content . length > 0 && (
101+ < div className = "bg-gray-800/30 border-t border-gray-800 p-4" >
102+ < div className = "flex justify-center" >
103+ < button className = "text-[#00d084] hover:text-[#00d084]/80 text-sm font-medium transition-colors" >
104+ 모든 알림 읽음으로 표시
105+ </ button >
106+ </ div >
107+ </ div >
108+ ) }
109+ </ section >
110+ </ div >
76111 </ div >
77112 ) ;
78113}
0 commit comments