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 { visitCount } from "$lib/utils/stores/visitCountStore";
|
||||||
import { goto } from "$app/navigation";
|
import { goto } from "$app/navigation";
|
||||||
import type { DatabaseUser } from "$lib/server/auth";
|
import type { DatabaseUser } from "$lib/server/auth";
|
||||||
|
export let user: any;
|
||||||
async function goHome() {
|
async function goHome() {
|
||||||
goto("/");
|
goto("/");
|
||||||
}
|
}
|
||||||
|
@ -47,5 +48,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-end flex justify-around md:justify-end mr-4">
|
<div class="navbar-end flex justify-around md:justify-end mr-4">
|
||||||
<p>Adventures: {count}</p>
|
<p>Adventures: {count}</p>
|
||||||
|
{#if user}
|
||||||
|
<p>Hello {user.first_name}</p>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
export let data;
|
||||||
import Footer from "$lib/components/Footer.svelte";
|
import Footer from "$lib/components/Footer.svelte";
|
||||||
import Navbar from "$lib/components/Navbar.svelte";
|
import Navbar from "$lib/components/Navbar.svelte";
|
||||||
import "../app.css";
|
import "../app.css";
|
||||||
|
|
||||||
// only show footer if scrolled to the bottom
|
// only show footer if scrolled to the bottom
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Navbar />
|
<Navbar user={data.user} />
|
||||||
<section>
|
<section>
|
||||||
<slot />
|
<slot />
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue