aboutsummaryrefslogtreecommitdiff
path: root/ui/src/routes/+layout.svelte
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2023-01-03 22:41:20 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2023-01-03 22:41:20 -0500
commit61612c8e1861ac704bbe592a623a41f12ebc9c11 (patch)
tree1da6ae40ab9badaf1ba2cc32eb671b4183f4680d /ui/src/routes/+layout.svelte
parent8b736f3c0b9b583cb69f01424d214d93d6a9136c (diff)
downloadpaste-61612c8e1861ac704bbe592a623a41f12ebc9c11.tar.gz
paste-61612c8e1861ac704bbe592a623a41f12ebc9c11.tar.xz
Add a messy but mostly working UI
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>