aboutsummaryrefslogtreecommitdiff
path: root/ui/src/routes/+layout.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/routes/+layout.svelte')
-rw-r--r--ui/src/routes/+layout.svelte14
1 files changed, 10 insertions, 4 deletions
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>