@@ -8,6 +8,7 @@ import { supabase } from '../../config/supabase';
88
99interface NotificationCenterProps {
1010 isDark : boolean ;
11+ className ?: string ;
1112}
1213
1314interface NotificationEntry {
@@ -54,7 +55,7 @@ function timeAgo(dateStr: string): string {
5455 return date . toLocaleDateString ( undefined , { month : 'short' , day : 'numeric' } ) ;
5556}
5657
57- export default function NotificationCenter ( { isDark } : NotificationCenterProps ) {
58+ export default function NotificationCenter ( { isDark, className } : NotificationCenterProps ) {
5859 const [ open , setOpen ] = useState ( false ) ;
5960 const [ loading , setLoading ] = useState ( false ) ;
6061 const [ notifications , setNotifications ] = useState < NotificationEntry [ ] > ( [ ] ) ;
@@ -144,18 +145,25 @@ export default function NotificationCenter({ isDark }: NotificationCenterProps)
144145 } ;
145146
146147 return (
147- < div className = "relative" ref = { dropdownRef } >
148+ < div className = { cn ( "relative" , className ) } ref = { dropdownRef } >
148149 { /* Bell Button */ }
149150 < button
150151 onClick = { ( ) => setOpen ( ! open ) }
151152 className = { cn (
152- "relative p-2 rounded-lg transition-colors" ,
153- isDark ? "hover:bg-white/10 text-white/60 hover:text-white" : "hover:bg-black/5 text-black/50 hover:text-black"
153+ "relative inline-flex h-8 w-8 items-center justify-center rounded-full border transition-colors" ,
154+ isDark
155+ ? "border-white/10 bg-white/5 text-white/70 hover:bg-white/10 hover:text-white"
156+ : "border-black/10 bg-black/5 text-black/60 hover:bg-black/10 hover:text-black"
154157 ) }
155158 >
156- < Bell className = "w-4.5 h-4.5 " />
159+ < Bell className = "h-4 w-4 " />
157160 { unreadCount > 0 && (
158- < span className = "absolute -top-0.5 -right-0.5 w-4.5 h-4.5 flex items-center justify-center rounded-full bg-red-500 text-[9px] font-bold text-white leading-none" >
161+ < span
162+ className = { cn (
163+ "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-[#FF8A5B] text-[9px] font-bold text-white leading-none ring-2" ,
164+ isDark ? "ring-[#0A0A0A]" : "ring-white"
165+ ) }
166+ >
159167 { unreadCount > 9 ? '9+' : unreadCount }
160168 </ span >
161169 ) }
@@ -164,8 +172,9 @@ export default function NotificationCenter({ isDark }: NotificationCenterProps)
164172 { /* Dropdown */ }
165173 { open && (
166174 < div className = { cn (
167- "absolute right-0 top-full mt-2 w-[380px] max-h-[480px] rounded-xl border shadow-2xl z-[100] flex flex-col overflow-hidden" ,
168- isDark ? "bg-[#121214] border-white/10 shadow-black/50" : "bg-white border-gray-200 shadow-lg shadow-gray-200/50"
175+ "absolute top-full mt-3 w-[min(92vw,380px)] max-h-[480px] rounded-2xl border shadow-2xl z-[100] flex flex-col overflow-hidden backdrop-blur-xl" ,
176+ "left-1/2 -translate-x-1/2 sm:left-auto sm:right-0 sm:translate-x-0" ,
177+ isDark ? "bg-[#0F0F12]/95 border-white/10 shadow-black/60" : "bg-white/95 border-gray-200 shadow-lg shadow-gray-200/50"
169178 ) } >
170179 { /* Header */ }
171180 < div className = { cn ( "px-4 py-3 border-b flex items-center justify-between shrink-0" , isDark ? "border-white/10" : "border-gray-100" ) } >
@@ -209,8 +218,8 @@ export default function NotificationCenter({ isDark }: NotificationCenterProps)
209218 onClick = { ( ) => { if ( ! n . is_read ) markRead ( n . id ) ; } }
210219 className = { cn (
211220 "px-4 py-3 flex items-start gap-3 transition-colors cursor-pointer" ,
212- ! n . is_read && ( isDark ? "bg-purple-500 /[0.03 ]" : "bg-blue -50/50 " ) ,
213- isDark ? "hover:bg-white/[0.02 ]" : "hover:bg-gray-50/50 "
221+ ! n . is_read && ( isDark ? "bg-[#FF8A5B] /[0.06 ]" : "bg-orange -50/60 " ) ,
222+ isDark ? "hover:bg-white/[0.04 ]" : "hover:bg-gray-50/60 "
214223 ) }
215224 >
216225 < div className = { cn ( "p-1.5 rounded-lg shrink-0 mt-0.5" , TYPE_COLORS [ n . type ] || TYPE_COLORS . info ) } >
@@ -219,7 +228,7 @@ export default function NotificationCenter({ isDark }: NotificationCenterProps)
219228 < div className = "flex-1 min-w-0" >
220229 < div className = "flex items-center gap-1.5" >
221230 < span className = { cn ( "text-xs font-semibold" , isDark ? "text-white" : "text-gray-900" ) } > { n . title } </ span >
222- { ! n . is_read && < div className = "w-1.5 h-1.5 rounded-full bg-purple-500 shrink-0" /> }
231+ { ! n . is_read && < div className = "w-1.5 h-1.5 rounded-full bg-[#FF8A5B] shrink-0" /> }
223232 </ div >
224233 { n . message && (
225234 < p className = { cn ( "text-[11px] mt-0.5 line-clamp-2" , isDark ? "text-white/40" : "text-gray-500" ) } > { n . message } </ p >
0 commit comments