From 7e29468247d0faf9f7f5377d1dd61ab96d9dc19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Tue, 27 Feb 2024 13:07:06 +0100 Subject: [PATCH] fix: layout doesn't refer to url --- src/routes/+layout.svelte | 4 ++-- src/routes/+page.ts | 7 +++++++ src/routes/card/+page.ts | 7 +++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 src/routes/+page.ts create mode 100644 src/routes/card/+page.ts diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index e9a3064..4af62dc 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -20,11 +20,11 @@ }); }); - $: onlyCard = $page.url.pathname === '/card'; + $: onlyCard = $page.data.card; goto('/card')} /> -
+
Back
diff --git a/src/routes/+page.ts b/src/routes/+page.ts new file mode 100644 index 0000000..02b06c7 --- /dev/null +++ b/src/routes/+page.ts @@ -0,0 +1,7 @@ +import type { PageLoad } from './$types'; + +export const load: PageLoad = () => { + return { + root: true + } +} \ No newline at end of file diff --git a/src/routes/card/+page.ts b/src/routes/card/+page.ts new file mode 100644 index 0000000..f5def39 --- /dev/null +++ b/src/routes/card/+page.ts @@ -0,0 +1,7 @@ +import type { PageLoad } from './$types'; + +export const load: PageLoad = () => { + return { + card: true + }; +};