Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/components/layout/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -283,7 +284,12 @@ export const Navbar = ({ toggleMobile, isMobileOpen }) => {
<motion.button
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
onClick={() => 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"
>
<Bell className="w-5 h-5" />
Expand Down
Loading