mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-30 02:09:37 +02:00
Add user name to Navbar component
This commit is contained in:
parent
f335917047
commit
3ab2918ed2
2 changed files with 6 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
|||
import { visitCount } from "$lib/utils/stores/visitCountStore";
|
||||
import { goto } from "$app/navigation";
|
||||
import type { DatabaseUser } from "$lib/server/auth";
|
||||
export let user: any;
|
||||
async function goHome() {
|
||||
goto("/");
|
||||
}
|
||||
|
@ -47,5 +48,8 @@
|
|||
</div>
|
||||
<div class="navbar-end flex justify-around md:justify-end mr-4">
|
||||
<p>Adventures: {count}</p>
|
||||
{#if user}
|
||||
<p>Hello {user.first_name}</p>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<script lang="ts">
|
||||
export let data;
|
||||
import Footer from "$lib/components/Footer.svelte";
|
||||
import Navbar from "$lib/components/Navbar.svelte";
|
||||
import "../app.css";
|
||||
|
||||
// only show footer if scrolled to the bottom
|
||||
</script>
|
||||
|
||||
<Navbar />
|
||||
<Navbar user={data.user} />
|
||||
<section>
|
||||
<slot />
|
||||
</section>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue