refactor(web-ui): remove automatic page headers
Docker / Docker Build & Push (push) Successful in 3m42s
Docker / Docker Build & Push (push) Successful in 3m42s
This commit is contained in:
1 parent
c7840936a3
commit
f7ccb4a173
6 files changed
+2
-106
No files matched your search
@@ -4,7 +4,6 @@
|
||||
import type { NavItem } from '../types';
|
||||
import Header from './Header.svelte';
|
||||
import NotificationStack from './NotificationStack.svelte';
|
||||
import PageHeader from './PageHeader.svelte';
|
||||
import { initPrimaryColor, setPrimaryColorUser } from '../primary-color.svelte';
|
||||
|
||||
let {
|
||||
@@ -22,8 +21,6 @@
|
||||
onNavigate,
|
||||
onProfile,
|
||||
onSettings,
|
||||
pageHeaderActions,
|
||||
showPageHeader = true,
|
||||
showSettings = true,
|
||||
theme = 'dark',
|
||||
username = '',
|
||||
@@ -42,19 +39,11 @@
|
||||
onNavigate?: (item: NavItem) => void;
|
||||
onProfile?: () => void;
|
||||
onSettings?: () => void;
|
||||
pageHeaderActions?: Snippet;
|
||||
showPageHeader?: boolean;
|
||||
showSettings?: boolean;
|
||||
theme?: 'dark' | 'light' | 'system';
|
||||
username?: string;
|
||||
} = $props();
|
||||
|
||||
const activeNavItem = $derived(
|
||||
navItems.find((item) =>
|
||||
item.href === '/' ? currentPath === '/' : currentPath === item.href || currentPath.startsWith(`${item.href}/`),
|
||||
),
|
||||
);
|
||||
|
||||
$effect(() => {
|
||||
setPrimaryColorUser(username);
|
||||
});
|
||||
@@ -83,14 +72,6 @@
|
||||
/>
|
||||
|
||||
<main class="sc-main">
|
||||
{#if showPageHeader && activeNavItem?.href !== '/about'}
|
||||
<PageHeader
|
||||
title={activeNavItem?.label ?? brand}
|
||||
description={activeNavItem?.description ??
|
||||
`Explore the ${activeNavItem?.label?.toLowerCase() ?? 'application'} section.`}
|
||||
actions={pageHeaderActions}
|
||||
/>
|
||||
{/if}
|
||||
{@render children?.()}
|
||||
</main>
|
||||
</div>
|
||||
@@ -1,35 +0,0 @@
|
||||
<script lang="ts">
|
||||
import type { Snippet } from 'svelte';
|
||||
|
||||
let {
|
||||
actions,
|
||||
children,
|
||||
description = '',
|
||||
subtitle = '',
|
||||
title
|
||||
}: {
|
||||
actions?: Snippet;
|
||||
children?: Snippet;
|
||||
description?: string;
|
||||
subtitle?: string;
|
||||
title: string;
|
||||
} = $props();
|
||||
|
||||
const supportingText = $derived(description || subtitle);
|
||||
</script>
|
||||
|
||||
<div class="sc-page-header">
|
||||
<div>
|
||||
<h1>{title}</h1>
|
||||
{#if supportingText}
|
||||
<p>{supportingText}</p>
|
||||
{/if}
|
||||
{@render children?.()}
|
||||
</div>
|
||||
|
||||
{#if actions}
|
||||
<div>
|
||||
{@render actions()}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
Reference in new issue
Block a user