diff --git a/src/components/layout/Navbar.jsx b/src/components/layout/Navbar.jsx index 4adaf18..68c6f75 100644 --- a/src/components/layout/Navbar.jsx +++ b/src/components/layout/Navbar.jsx @@ -22,6 +22,7 @@ export const Navbar = ({ toggleMobile, isMobileOpen }) => { return "Good evening"; })(); const notificationRef = useRef(null); + const notificationToggleRef = useRef(false); const navigate = useNavigate(); const hasSearchQuery = searchQuery.trim().length > 0; @@ -283,7 +284,12 @@ export const Navbar = ({ toggleMobile, isMobileOpen }) => { setShowNotifications(!showNotifications)} + onClick={() => { + if (notificationToggleRef.current) return; + notificationToggleRef.current = true; + setShowNotifications(prev => !prev); + setTimeout(() => { notificationToggleRef.current = false; }, 300); + }} className="p-2 rounded-xl border border-slate-200/50 dark:border-slate-800/50 bg-white/80 dark:bg-slate-900/80 backdrop-blur-md text-slate-700 dark:text-slate-300 w-10 h-10 flex items-center justify-center cursor-pointer hover:shadow-sm relative" >