feat: Restrict notifications feature to admin users only in navigation

This commit is contained in:
2025-10-06 16:07:17 +02:00
parent 80a53d5d15
commit e19172d2bb

View File

@@ -96,7 +96,8 @@ const Navigation = () => {
<div className="text-blue-100">{t('navigation.loading')}</div> <div className="text-blue-100">{t('navigation.loading')}</div>
) : session ? ( ) : session ? (
<> <>
{/* Notifications */} {/* Notifications - Admin only for now */}
{session?.user?.role === 'admin' && (
<div className="relative" ref={notificationsRef}> <div className="relative" ref={notificationsRef}>
<button <button
onClick={() => setIsNotificationsOpen(!isNotificationsOpen)} onClick={() => setIsNotificationsOpen(!isNotificationsOpen)}
@@ -126,6 +127,7 @@ const Navigation = () => {
</div> </div>
)} )}
</div> </div>
)}
{/* User Info */} {/* User Info */}
<div className="hidden md:flex items-center space-x-3"> <div className="hidden md:flex items-center space-x-3">
@@ -220,7 +222,8 @@ const Navigation = () => {
</div> </div>
</Link> </Link>
<div className="flex items-center space-x-2"> <div className="flex items-center space-x-2">
{/* Mobile Notifications */} {/* Mobile Notifications - Admin only for now */}
{session?.user?.role === 'admin' && (
<button <button
onClick={() => { onClick={() => {
setIsNotificationsOpen(!isNotificationsOpen); setIsNotificationsOpen(!isNotificationsOpen);
@@ -236,6 +239,7 @@ const Navigation = () => {
0 0
</span> </span>
</button> </button>
)}
<button <button
onClick={() => { onClick={() => {
setIsMobileMenuOpen(false); setIsMobileMenuOpen(false);