improve layout, nav; add sign out on user page

This commit is contained in:
2024-11-01 00:05:53 -07:00
parent 5fc9cf25c8
commit 31d23c5e87
7 changed files with 58 additions and 27 deletions

View File

@@ -1,13 +1,21 @@
<script lang="ts">
import '../app.css';
let { children } = $props();
import { page } from '$app/stores';
import { cn } from '$lib/utils';
const { data, children } = $props();
const { user } = data;
</script>
<header class="p-4">
<h1 class="text-2xl font-bold">My App</h1>
<nav>
<a href="/">Home</a>
<a href="/about">About</a>
<header class="p-4 md:flex">
<span class=" mr-6 font-bold xl:inline-block">My App</span>
<nav class="flex items-center gap-6 text-sm">
<a href="/" class={cn("hover:text-foreground/80 transition-colors",
$page.url.pathname === "/" ? "text-foreground" : "text-foreground/60")}>Home</a>
{#if user}
<a href="/user" class={cn("hover:text-foreground/80 transition-colors",
$page.url.pathname === "/user" ? "text-foreground" : "text-foreground/60")}>Profile</a>
{/if}
</nav>
</header>
<main class="flex-grow p-4">