2024-09-23 20:10:15 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import {page} from "$app/stores"
|
2026-03-12 23:41:07 +00:00
|
|
|
import theme from "tailwindcss/defaultTheme"
|
|
|
|
|
import SecondaryNav from "@lib/components/SecondaryNav.svelte"
|
2026-06-08 22:33:38 +00:00
|
|
|
import {decodeRelay} from "@app/relays"
|
2026-06-08 21:14:40 +00:00
|
|
|
import {goToSpace} from "@app/routes"
|
2026-03-12 23:41:07 +00:00
|
|
|
import SpaceMenu from "@app/components/SpaceMenu.svelte"
|
2024-09-23 20:10:15 +00:00
|
|
|
|
2026-03-12 23:41:07 +00:00
|
|
|
const url = decodeRelay($page.params.relay!)
|
2026-04-10 20:08:32 +00:00
|
|
|
const md = parseFloat(theme.screens.md) * 16
|
2026-03-12 23:41:07 +00:00
|
|
|
|
2026-06-16 22:04:39 +00:00
|
|
|
let width = $state(window.innerWidth)
|
2026-03-13 00:31:28 +00:00
|
|
|
|
|
|
|
|
$effect(() => {
|
|
|
|
|
if (width > md) {
|
2026-09-02 23:42:29 +00:00
|
|
|
goToSpace(url, {replaceState: true})
|
2026-03-13 00:31:28 +00:00
|
|
|
}
|
|
|
|
|
})
|
2024-09-23 20:10:15 +00:00
|
|
|
</script>
|
2026-03-12 23:41:07 +00:00
|
|
|
|
2026-03-13 00:31:28 +00:00
|
|
|
<svelte:window bind:innerWidth={width} />
|
|
|
|
|
|
|
|
|
|
{#if width <= md}
|
2026-07-08 22:03:08 +00:00
|
|
|
<SecondaryNav visible class="secondary-nav--mobile-space w-auto grow">
|
2026-07-07 21:23:52 +00:00
|
|
|
<SpaceMenu {url} mobile />
|
2026-03-12 23:41:07 +00:00
|
|
|
</SecondaryNav>
|
|
|
|
|
{/if}
|