aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Menu.svelte
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-12-06 09:16:32 -0800
committerAdam Soltys <[email protected]>2024-12-06 09:16:32 -0800
commit0fab33bcfa96500708bca2f94b0e43fa5ddc4976 (patch)
tree13fc34c2793e1c389f8adef55ad55b256caedde2 /src/components/Menu.svelte
parent04232a4f32fdd7a18846f852627c20cee675a344 (diff)
downloadcoinos-ui-0fab33bcfa96500708bca2f94b0e43fa5ddc4976.tar.gz
coinos-ui-0fab33bcfa96500708bca2f94b0e43fa5ddc4976.zip
update settings page
Diffstat (limited to 'src/components/Menu.svelte')
-rw-r--r--src/components/Menu.svelte44
1 files changed, 18 insertions, 26 deletions
diff --git a/src/components/Menu.svelte b/src/components/Menu.svelte
index de21bbbc..7268b74b 100644
--- a/src/components/Menu.svelte
+++ b/src/components/Menu.svelte
@@ -1,35 +1,24 @@
<script>
- import { run } from 'svelte/legacy';
-
import { theme } from "$lib/store";
import DarkToggle from "$comp/DarkToggle.svelte";
import OutClick from "svelte-outclick";
- let {
- t,
- user,
- w,
- opacity
- } = $props();
+ let { t, user, w, opacity } = $props();
let dark = () => ($theme = $theme === "dark" ? "light" : "dark");
let showMenu = $state(false);
- let menuButtons = $state();
- run(() => {
- if (user)
- menuButtons = [
- { key: "nav.settings", icon: "ph:gear-bold", href: `/settings` },
- { key: "nav.support", icon: "ph:lifebuoy-bold", href: `/support` },
- { key: "nav.map", icon: "ph:map-trifold-bold", href: `/map` },
- {
- key: "nav.merch",
- icon: "ph:storefront-bold",
- href: `https://coinosmerch.com`,
- },
- { key: "nav.dark", icon: "ph:moon-stars-bold", href: `/dark` },
- { key: "nav.signOut", icon: "ph:sign-out-bold", href: `/logout` },
- ];
- });
+ let menuButtons = [
+ { key: "nav.settings", icon: "ph:gear-bold", href: `/settings` },
+ { key: "nav.support", icon: "ph:lifebuoy-bold", href: `/support` },
+ { key: "nav.map", icon: "ph:map-trifold-bold", href: `/map` },
+ {
+ key: "nav.merch",
+ icon: "ph:storefront-bold",
+ href: `https://coinosmerch.com`,
+ },
+ { key: "nav.dark", icon: "ph:moon-stars-bold", href: `/dark` },
+ { key: "nav.signOut", icon: "ph:sign-out-bold", href: `/logout` },
+ ];
let hideMenu = () => (showMenu = false);
let toggleMenu = () => (showMenu = !showMenu);
@@ -38,7 +27,8 @@
<div>
<OutClick on:outclick={hideMenu}>
<button class="btn-menu {opacity('/support')}" onclick={toggleMenu}
- ><iconify-icon icon="ph:list-bold" width={w > 640 ? 32 : 24}></iconify-icon>
+ ><iconify-icon icon="ph:list-bold" width={w > 640 ? 32 : 24}
+ ></iconify-icon>
</button>
<div
@@ -70,7 +60,9 @@
{/each}
</ul>
<hr class="my-4" />
- <a href="/?stay=true"><iconify-icon icon="coinos:logo" width="160"></iconify-icon></a>
+ <a href="/?stay=true"
+ ><iconify-icon icon="coinos:logo" width="160"></iconify-icon></a
+ >
</div>
</OutClick>
</div>