feat(AppHeader): add notifications click handler and count display

This commit is contained in:
estifanos
2026-08-05 09:26:20 +00:00
parent bedc7d5f8c
commit f06f74b9e0
2 changed files with 15 additions and 1 deletions

View File

@@ -255,6 +255,8 @@ export function PortalLayout() {
userName={displayName || t("app.name")}
userInitials={initials}
supportedLanguages={SUPPORTED_LANGUAGES}
onNotificationsClick={() => navigate("/notifications")}
notificationCount={unseen?.count}
/>
</AppShell.Header>

View File

@@ -34,6 +34,8 @@ interface AppHeaderProps {
userName?: string;
userInitials?: string;
supportedLanguages: readonly string[];
onNotificationsClick?: () => void;
notificationCount?: number;
}
export function AppHeader({
@@ -46,6 +48,8 @@ export function AppHeader({
userName = 'User',
userInitials = '?',
supportedLanguages,
onNotificationsClick,
notificationCount,
}: AppHeaderProps) {
const isMobile = typeof window !== 'undefined' && window.innerWidth < 768;
@@ -201,9 +205,17 @@ export function AppHeader({
e.currentTarget.style.boxShadow =
'0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.06)';
}}
onClick={onNotificationsClick}
aria-label="Notifications"
>
<Indicator color="red" size={9} offset={5} withBorder>
<Indicator
color="red"
size={notificationCount ? 16 : 9}
offset={notificationCount ? 2 : 5}
withBorder
disabled={notificationCount === 0}
label={notificationCount || undefined}
>
<IconBell size={19} />
</Indicator>
</UnstyledButton>