Update internal server options and enhance layout logic for user-specific routes. Changed version hash and added pathname tracking to conditionally render user menu based on site routes.
CI / build (push) Has been skipped
CI / deploy (push) Successful in 1m3s

This commit is contained in:
eewing
2026-02-18 15:38:47 -06:00
parent 1f14c6d422
commit 1af7aeb7d9
2 changed files with 16 additions and 2 deletions
+15 -1
View File
@@ -2,18 +2,32 @@
import { browser } from '$app/environment';
import { enhance } from '$app/forms';
import { invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { get } from 'svelte/store';
import { onMount } from 'svelte';
import './layout.css';
import * as Avatar from '$lib/components/ui/avatar';
import * as DropdownMenu from '$lib/components/ui/dropdown-menu';
import { Label } from '$lib/components/ui/label';
import { Switch } from '$lib/components/ui/switch';
import { siteSlugs } from '$lib/sites';
let { data, children }: {
data: { user: { id: string; email?: string; name?: string; avatar?: string; darkmode: boolean } | null };
children: import('svelte').Snippet;
} = $props();
let pathname = $state(get(page).url.pathname);
$effect(() => {
const unsub = page.subscribe((p) => {
pathname = p.url.pathname;
});
return unsub;
});
const isSiteRoute = $derived(
(siteSlugs as readonly string[]).includes(pathname.slice(1).split('/')[0] ?? '')
);
let darkmode = $state(false);
let onDarkmodeChange: (checked: boolean) => void = () => {};
@@ -45,7 +59,7 @@
</script>
<div class="app-shell">
{#if data.user}
{#if data.user && !isSiteRoute}
<header
class="fixed right-0 top-0 z-50 flex items-center gap-2 p-2 pr-[max(0.5rem,env(safe-area-inset-right))] pt-[max(0.5rem,env(safe-area-inset-top))]"
aria-label="User menu"