2026-04-17 15:28:22 +02:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { onMount } from 'svelte';
|
|
|
|
|
import { profileStore } from '$lib/client/profile.svelte';
|
|
|
|
|
import ProfileSwitcher from '$lib/components/ProfileSwitcher.svelte';
|
feat(ui): custom confirmation dialog replacing native window.confirm
Single reusable dialog with a promise-based API: confirmAction({...})
returns Promise<boolean>. Supports title, optional message body,
confirm/cancel labels, and a 'destructive' flag that paints the confirm
button red.
Accessibility: Escape cancels, Enter confirms, confirm button auto-focus,
role=dialog + aria-labelledby, backdrop click = cancel.
Rolled out to: recipe delete, domain remove, profile delete, wishlist
remove. Native confirm() is gone from the codebase.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 17:15:21 +02:00
|
|
|
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte';
|
2026-04-17 15:28:22 +02:00
|
|
|
|
|
|
|
|
let { children } = $props();
|
|
|
|
|
|
|
|
|
|
onMount(() => {
|
|
|
|
|
profileStore.load();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
feat(ui): custom confirmation dialog replacing native window.confirm
Single reusable dialog with a promise-based API: confirmAction({...})
returns Promise<boolean>. Supports title, optional message body,
confirm/cancel labels, and a 'destructive' flag that paints the confirm
button red.
Accessibility: Escape cancels, Enter confirms, confirm button auto-focus,
role=dialog + aria-labelledby, backdrop click = cancel.
Rolled out to: recipe delete, domain remove, profile delete, wishlist
remove. Native confirm() is gone from the codebase.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 17:15:21 +02:00
|
|
|
<ConfirmDialog />
|
|
|
|
|
|
2026-04-17 15:28:22 +02:00
|
|
|
<header class="bar">
|
|
|
|
|
<a href="/" class="brand">Kochwas</a>
|
2026-04-17 15:35:20 +02:00
|
|
|
<div class="bar-right">
|
2026-04-17 17:08:22 +02:00
|
|
|
<a href="/wishlist" class="nav-link" aria-label="Wunschliste">🍽️</a>
|
|
|
|
|
<a href="/admin" class="nav-link" aria-label="Einstellungen">⚙️</a>
|
2026-04-17 15:35:20 +02:00
|
|
|
<ProfileSwitcher />
|
|
|
|
|
</div>
|
2026-04-17 15:28:22 +02:00
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
<main>
|
|
|
|
|
{@render children()}
|
|
|
|
|
</main>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
:global(html, body) {
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 0;
|
|
|
|
|
background: #f8faf8;
|
|
|
|
|
color: #1a1a1a;
|
|
|
|
|
font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
|
|
}
|
|
|
|
|
:global(a) {
|
|
|
|
|
color: #2b6a3d;
|
|
|
|
|
}
|
|
|
|
|
:global(*) {
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
|
|
|
|
.bar {
|
|
|
|
|
position: sticky;
|
|
|
|
|
top: 0;
|
|
|
|
|
z-index: 10;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 0.75rem 1rem;
|
|
|
|
|
background: white;
|
|
|
|
|
border-bottom: 1px solid #e4eae7;
|
|
|
|
|
}
|
|
|
|
|
.brand {
|
|
|
|
|
font-size: 1.15rem;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
color: #2b6a3d;
|
|
|
|
|
}
|
2026-04-17 15:35:20 +02:00
|
|
|
.bar-right {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
}
|
2026-04-17 17:08:22 +02:00
|
|
|
.nav-link {
|
2026-04-17 15:35:20 +02:00
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
width: 40px;
|
|
|
|
|
height: 40px;
|
|
|
|
|
border-radius: 999px;
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
font-size: 1.15rem;
|
|
|
|
|
}
|
2026-04-17 17:08:22 +02:00
|
|
|
.nav-link:hover {
|
2026-04-17 15:35:20 +02:00
|
|
|
background: #f4f8f5;
|
|
|
|
|
}
|
2026-04-17 15:28:22 +02:00
|
|
|
main {
|
|
|
|
|
padding: 0 1rem 4rem;
|
|
|
|
|
max-width: 760px;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
}
|
|
|
|
|
</style>
|