Changeset 73b69b2 for chapterx-frontend/src/components/layout
- Timestamp:
- 03/24/26 22:13:36 (3 months ago)
- Branches:
- main
- Children:
- 7fbb91c
- Parents:
- acf690c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapterx-frontend/src/components/layout/Navbar.tsx
racf690c r73b69b2 14 14 const location = useLocation() 15 15 const { currentUser, logout } = useAuthStore() 16 const { notifications } = useNotificationStore()16 const { notifications, fetchUserNotifications } = useNotificationStore() 17 17 const unread = notifications.filter(n => !n.is_read).length 18 19 useEffect(() => { 20 if (currentUser) fetchUserNotifications(currentUser.user_id) 21 }, [currentUser?.user_id]) 18 22 19 23 const [mobileOpen, setMobileOpen] = useState(false) … … 100 104 <div className="relative" ref={notifRef}> 101 105 <button 102 onClick={() => { setNotifOpen(!notifOpen); setUserMenuOpen(false) }}106 onClick={() => { const opening = !notifOpen; setNotifOpen(opening); setUserMenuOpen(false); if (opening && currentUser) fetchUserNotifications(currentUser.user_id) }} 103 107 className="relative p-2 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition-colors" 104 108 >
Note:
See TracChangeset
for help on using the changeset viewer.
