1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-27 00:39:37 +02:00
AdventureLog/src/lib/components/Navbar.svelte

24 lines
710 B
Svelte
Raw Normal View History

<script lang="ts">
import { getNumberOfAdventures } from "../../services/adventureService";
import { goto } from '$app/navigation';
async function goHome() {
goto('/');
}
async function goToLog() {
goto('/log');
}
</script>
<div class="navbar bg-base-100">
<div class="navbar-start">
<button class="btn btn-primary mr-4 ml-2" on:click={goHome}>Home</button>
<button class="btn btn-primary" on:click={goToLog}>My Log</button>
</div>
<div class="navbar-center">
<a class="btn btn-ghost text-xl" href="/">AdventureLog 🗺️</a>
</div>
<div class="navbar-end">
<p>Adventures: {getNumberOfAdventures()} </p>
</div>
</div>