fix: layout doesn't refer to url

develop
Tomáš Mládek 2024-02-27 13:07:06 +01:00
parent fd25154725
commit 7e29468247
3 changed files with 16 additions and 2 deletions

View File

@ -20,11 +20,11 @@
});
});
$: onlyCard = $page.url.pathname === '/card';
$: onlyCard = $page.data.card;
</script>
<TestCard full={onlyCard} on:focus={() => goto('/card')} />
<main class:content={!onlyCard} class:sub={$page.url.pathname !== '/' && !onlyCard}>
<main class:content={!onlyCard} class:sub={!$page.data.root && !onlyCard}>
<a href=".." class="button button-back"><i class="ti ti-arrow-back" />Back</a>
<slot />
</main>

7
src/routes/+page.ts Normal file
View File

@ -0,0 +1,7 @@
import type { PageLoad } from './$types';
export const load: PageLoad = () => {
return {
root: true
}
}

7
src/routes/card/+page.ts Normal file
View File

@ -0,0 +1,7 @@
import type { PageLoad } from './$types';
export const load: PageLoad = () => {
return {
card: true
};
};