feat(shell): add route groups, layout server load, redirect, and placeholder pages
- (app) group with AppShell layout, loads user/household from locals - (public) group with full-viewport split layout, /login placeholder - Root / redirects to /planner for authenticated users - Placeholder stubs for planner, recipes, shopping, settings, members Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
import TabletNavBar from './TabletNavBar.svelte';
|
||||
import DesktopSidebar from './DesktopSidebar.svelte';
|
||||
|
||||
let { appName, householdName, children }: { appName: string; householdName: string; children: Snippet } = $props();
|
||||
let { appName, householdName, children }: { appName: string; householdName: string; children?: Snippet } = $props();
|
||||
</script>
|
||||
|
||||
<div class="flex min-h-screen bg-[var(--color-page)]">
|
||||
|
||||
8
frontend/src/routes/(app)/+layout.server.ts
Normal file
8
frontend/src/routes/(app)/+layout.server.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { LayoutServerLoad } from './$types';
|
||||
|
||||
export const load: LayoutServerLoad = async ({ locals }) => {
|
||||
return {
|
||||
benutzer: locals.benutzer!,
|
||||
haushalt: locals.haushalt!
|
||||
};
|
||||
};
|
||||
9
frontend/src/routes/(app)/+layout.svelte
Normal file
9
frontend/src/routes/(app)/+layout.svelte
Normal file
@@ -0,0 +1,9 @@
|
||||
<script lang="ts">
|
||||
import AppShell from '$lib/nav/AppShell.svelte';
|
||||
|
||||
let { data, children } = $props();
|
||||
</script>
|
||||
|
||||
<AppShell appName="Mealprep" householdName={data.haushalt.name}>
|
||||
{@render children()}
|
||||
</AppShell>
|
||||
1
frontend/src/routes/(app)/members/+page.svelte
Normal file
1
frontend/src/routes/(app)/members/+page.svelte
Normal file
@@ -0,0 +1 @@
|
||||
<h1 class="text-2xl font-medium p-6">Mitglieder</h1>
|
||||
1
frontend/src/routes/(app)/planner/+page.svelte
Normal file
1
frontend/src/routes/(app)/planner/+page.svelte
Normal file
@@ -0,0 +1 @@
|
||||
<h1 class="text-2xl font-medium p-6">Planer</h1>
|
||||
1
frontend/src/routes/(app)/recipes/+page.svelte
Normal file
1
frontend/src/routes/(app)/recipes/+page.svelte
Normal file
@@ -0,0 +1 @@
|
||||
<h1 class="text-2xl font-medium p-6">Rezepte</h1>
|
||||
1
frontend/src/routes/(app)/settings/+page.svelte
Normal file
1
frontend/src/routes/(app)/settings/+page.svelte
Normal file
@@ -0,0 +1 @@
|
||||
<h1 class="text-2xl font-medium p-6">Einstellungen</h1>
|
||||
1
frontend/src/routes/(app)/shopping/+page.svelte
Normal file
1
frontend/src/routes/(app)/shopping/+page.svelte
Normal file
@@ -0,0 +1 @@
|
||||
<h1 class="text-2xl font-medium p-6">Einkaufsliste</h1>
|
||||
12
frontend/src/routes/(public)/+layout.svelte
Normal file
12
frontend/src/routes/(public)/+layout.svelte
Normal file
@@ -0,0 +1,12 @@
|
||||
<script>
|
||||
let { children } = $props();
|
||||
</script>
|
||||
|
||||
<div class="flex min-h-screen">
|
||||
<div class="hidden md:flex md:w-1/2 bg-[var(--green)] items-center justify-center">
|
||||
<span class="font-[var(--font-display)] text-4xl text-white font-medium">Mealprep</span>
|
||||
</div>
|
||||
<div class="flex-1 flex items-center justify-center p-6">
|
||||
{@render children()}
|
||||
</div>
|
||||
</div>
|
||||
2
frontend/src/routes/(public)/login/+page.svelte
Normal file
2
frontend/src/routes/(public)/login/+page.svelte
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1 class="text-2xl font-medium">Anmelden</h1>
|
||||
<p class="text-[var(--color-text-muted)] mt-2">Login-Formular folgt.</p>
|
||||
6
frontend/src/routes/+page.server.ts
Normal file
6
frontend/src/routes/+page.server.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
export const load: PageServerLoad = async () => {
|
||||
redirect(302, '/planner');
|
||||
};
|
||||
1
frontend/src/routes/+page.svelte
Normal file
1
frontend/src/routes/+page.svelte
Normal file
@@ -0,0 +1 @@
|
||||
<p>Weiterleitung...</p>
|
||||
Reference in New Issue
Block a user