From 61612c8e1861ac704bbe592a623a41f12ebc9c11 Mon Sep 17 00:00:00 2001
From: Mitchell Riedstra <mitch@riedstra.dev>
Date: Tue, 3 Jan 2023 22:41:20 -0500
Subject: Add a messy but mostly working UI

---
 ui/src/routes/+layout.svelte | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

(limited to 'ui/src/routes/+layout.svelte')

diff --git a/ui/src/routes/+layout.svelte b/ui/src/routes/+layout.svelte
index e9fd192..4f83f18 100644
--- a/ui/src/routes/+layout.svelte
+++ b/ui/src/routes/+layout.svelte
@@ -1,11 +1,17 @@
+<script>
+	import { browser } from '$app/environment';
+	const loggedIn = browser ? window.localStorage.getItem('loggedIn') === "true": false
+</script>
 <body>
     <nav>
         <a href="/">Home</a>
-        |
+        {#if loggedIn }
+		|
         <a href="/new">New</a>
-        <a href="/login" class="nav-right">Login</a>
-        <span class="nav-right">|</span>
         <a href="/api/v1/logout" class="nav-right">Logout</a>
+		{:else}
+        <a href="/login" class="nav-right">Login</a>
+		{/if}
     </nav>
 
 
@@ -139,4 +145,4 @@ h1,h2,h3 {
 
 }
 
-</style>
\ No newline at end of file
+</style>
-- 
cgit v1.2.3

