diff options
Diffstat (limited to 'src/routes/+layout.svelte')
| -rw-r--r-- | src/routes/+layout.svelte | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index e5aeb206..a2dc3bff 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,4 +1,6 @@ <script> + import { run } from 'svelte/legacy'; + import { browser } from "$app/environment"; import { PUBLIC_DOMAIN } from "$env/static/public"; import "../app.css"; @@ -6,15 +8,17 @@ import { onMount } from "svelte"; import { installPrompt, theme as themeStore } from "$lib/store"; - export let data; - let { pathname, theme } = data; + let { data, children } = $props(); + let { pathname, theme } = $state(data); $themeStore = theme; let host = PUBLIC_DOMAIN.includes("localhost") ? `http://${PUBLIC_DOMAIN}` : `https://${PUBLIC_DOMAIN}`; - $: theme = $themeStore + run(() => { + theme = $themeStore + }); onMount(() => { if (!browser) return; @@ -48,7 +52,7 @@ {#if !$loading} <main data-theme={theme}> - <slot /> + {@render children?.()} </main> {/if} |
