flotilla/src/routes/settings/+layout.svelte

62 lines
1.8 KiB
Svelte
Raw Normal View History

2024-08-16 22:17:30 +00:00
<script lang="ts">
2025-05-12 15:47:44 +00:00
import type {Snippet} from "svelte"
2024-08-16 22:17:30 +00:00
import {fly} from "@lib/transition"
import Icon from "@lib/components/Icon.svelte"
import Page from "@lib/components/Page.svelte"
import SecondaryNav from "@lib/components/SecondaryNav.svelte"
import SecondaryNavItem from "@lib/components/SecondaryNavItem.svelte"
import SecondaryNavSection from "@lib/components/SecondaryNavSection.svelte"
import LogOut from "@app/components/LogOut.svelte"
import {pushModal} from "@app/modal"
2025-05-12 15:47:44 +00:00
import {theme} from "@app/theme"
type Props = {
children?: Snippet
2025-02-04 00:37:14 +00:00
}
const {children}: Props = $props()
2024-08-16 22:17:30 +00:00
const logout = () => pushModal(LogOut)
2025-05-12 15:47:44 +00:00
const toggleTheme = () => theme.set($theme === "dark" ? "light" : "dark")
2024-08-16 22:17:30 +00:00
</script>
<SecondaryNav>
<SecondaryNavSection>
<div in:fly|local>
2024-10-02 23:36:08 +00:00
<SecondaryNavItem href="/settings/profile">
<Icon icon="user-circle" /> Profile
</SecondaryNavItem>
</div>
2024-10-09 17:01:39 +00:00
<div in:fly|local={{delay: 50}}>
2024-08-23 23:54:05 +00:00
<SecondaryNavItem href="/settings/relays">
2024-10-18 22:58:44 +00:00
<Icon icon="server" /> Relays
2024-08-23 23:54:05 +00:00
</SecondaryNavItem>
</div>
2024-10-09 17:01:39 +00:00
<div in:fly|local={{delay: 100}}>
<SecondaryNavItem href="/settings">
<Icon icon="settings" /> Settings
</SecondaryNavItem>
</div>
2024-10-02 23:36:08 +00:00
<div in:fly|local={{delay: 150}}>
2025-05-12 15:47:44 +00:00
<SecondaryNavItem onclick={toggleTheme}>
<Icon icon="moon" /> Theme
</SecondaryNavItem>
</div>
<div in:fly|local={{delay: 200}}>
2024-08-23 22:43:35 +00:00
<SecondaryNavItem href="/settings/about">
<Icon icon="info-square" /> About
</SecondaryNavItem>
</div>
2025-05-12 15:47:44 +00:00
<div in:fly|local={{delay: 250}}>
<SecondaryNavItem class="text-error hover:text-error" onclick={logout}>
2024-08-16 22:17:30 +00:00
<Icon icon="exit" /> Log Out
</SecondaryNavItem>
</div>
</SecondaryNavSection>
</SecondaryNav>
<Page>
2025-02-04 00:37:14 +00:00
{@render children?.()}
2024-08-16 22:17:30 +00:00
</Page>