diff --git a/hexawebshare/src/components/admin/layout/AdminTopbar.stories.svelte b/hexawebshare/src/components/admin/layout/AdminTopbar.stories.svelte
index 6b9f1e1..abd7b0c 100644
--- a/hexawebshare/src/components/admin/layout/AdminTopbar.stories.svelte
+++ b/hexawebshare/src/components/admin/layout/AdminTopbar.stories.svelte
@@ -14,6 +14,9 @@ SPDX-License-Identifier: MIT
argTypes: {
onToggleSidebar: { action: 'toggleSidebar' },
onSearch: { action: 'search' },
+ onNotificationClick: { action: 'notificationClicked' },
+ onEmptyNotificationClick: { action: 'emptyNotificationClicked' },
+ onLoginClick: { action: 'loginClicked' },
user: { control: 'object' },
notifications: { control: 'object' },
loginLabel: { control: 'text' },
diff --git a/hexawebshare/src/components/admin/layout/AdminTopbar.svelte b/hexawebshare/src/components/admin/layout/AdminTopbar.svelte
index 5145ad7..a796881 100644
--- a/hexawebshare/src/components/admin/layout/AdminTopbar.svelte
+++ b/hexawebshare/src/components/admin/layout/AdminTopbar.svelte
@@ -50,6 +50,9 @@ SPDX-License-Identifier: MIT
onProfileClick?: () => void;
onSettingsClick?: () => void;
onLogoutClick?: () => void;
+ onNotificationClick?: (notificationId: string) => void;
+ onEmptyNotificationClick?: () => void;
+ onLoginClick?: () => void;
// Icons
profileIcon?: string;
settingsIcon?: string;
@@ -75,6 +78,9 @@ SPDX-License-Identifier: MIT
onProfileClick,
onSettingsClick,
onLogoutClick,
+ onNotificationClick,
+ onEmptyNotificationClick,
+ onLoginClick,
profileIcon = '👤',
settingsIcon = '⚙️',
logoutIcon = '🚪',
@@ -106,6 +112,13 @@ SPDX-License-Identifier: MIT
{ id: 'sep', type: 'divider', label: '' },
{ id: 'logout', label: logoutLabel, icon: logoutIcon, variant: 'error', onClick: onLogoutClick }
];
+
+ // Handle notification item click
+ function handleNotificationClick(item: MenuItem) {
+ if (onNotificationClick && typeof item.id === 'string') {
+ onNotificationClick(item.id);
+ }
+ }
@@ -222,7 +235,12 @@ SPDX-License-Identifier: MIT
{/snippet}
{#snippet children()}
-
+
{/snippet}
{:else}
@@ -230,7 +248,7 @@ SPDX-License-Identifier: MIT
variant="ghost"
circle
ariaLabel={notificationsLabel}
- onclick={() => console.log('No notifications')}
+ onclick={onEmptyNotificationClick}
>
diff --git a/hexawebshare/src/components/core/overlay-navigation/Dropdown.svelte b/hexawebshare/src/components/core/overlay-navigation/Dropdown.svelte
index 02e19df..5928b1f 100644
--- a/hexawebshare/src/components/core/overlay-navigation/Dropdown.svelte
+++ b/hexawebshare/src/components/core/overlay-navigation/Dropdown.svelte
@@ -538,7 +538,22 @@ SPDX-License-Identifier: MIT