Update shared web UI auth and profile menu
This commit is contained in:
1 parent
e3544617e1
commit
d0b18a4902
5 files changed
+189
-20
No files matched your search
@@ -5,6 +5,7 @@
|
||||
import PageHeader from './PageHeader.svelte';
|
||||
|
||||
let {
|
||||
aboutHref,
|
||||
brand = 'Application',
|
||||
brandHref = '/',
|
||||
children,
|
||||
@@ -12,6 +13,7 @@
|
||||
currentPath = '',
|
||||
headerActions,
|
||||
navItems = [],
|
||||
onAbout,
|
||||
onLogout,
|
||||
onNavigate,
|
||||
onProfile,
|
||||
@@ -21,6 +23,7 @@
|
||||
theme = 'dark',
|
||||
username = '',
|
||||
}: {
|
||||
aboutHref?: string;
|
||||
brand?: string;
|
||||
brandHref?: string;
|
||||
children?: Snippet;
|
||||
@@ -28,6 +31,7 @@
|
||||
currentPath?: string;
|
||||
headerActions?: Snippet;
|
||||
navItems?: NavItem[];
|
||||
onAbout?: () => void | Promise<void>;
|
||||
onLogout?: () => void | Promise<void>;
|
||||
onNavigate?: (item: NavItem) => void;
|
||||
onProfile?: () => void;
|
||||
@@ -47,11 +51,13 @@
|
||||
|
||||
<div class={`sc-root sc-app-shell ${className}`} data-theme={theme === 'system' ? undefined : theme}>
|
||||
<Header
|
||||
aboutHref={aboutHref ?? navItems.find((item) => item.label.toLowerCase() === 'about')?.href}
|
||||
{brand}
|
||||
{brandHref}
|
||||
{currentPath}
|
||||
actions={headerActions}
|
||||
{navItems}
|
||||
{onAbout}
|
||||
{onLogout}
|
||||
{onNavigate}
|
||||
{onProfile}
|
||||
|
||||
Reference in new issue
Block a user