tablet: split price/pfand, light mode, bigger bold text

- show drink price and Pfand separately on tiles and in cart
- add light/dark toggle on the bar-picker page (persisted)
- theme via CSS variables, applied on load for tablet + admin
- larger, bolder text throughout; much bigger total sum
This commit is contained in:
müde 2026-06-14 21:57:52 +02:00
commit 2a43b59947
6 changed files with 111 additions and 28 deletions

View file

@ -1,4 +1,6 @@
import { useState } from 'preact/hooks';
import type { Bar } from '@wutzcalc/shared';
import { getTheme, setTheme } from '../api';
interface Props {
bars: Bar[] | null;
@ -6,6 +8,14 @@ interface Props {
}
export function BarPicker({ bars, onPick }: Props) {
const [theme, setThemeState] = useState(getTheme());
function toggleTheme() {
const next = theme === 'dark' ? 'light' : 'dark';
setTheme(next);
setThemeState(next);
}
return (
<div class="bar-picker">
<h1>Bar auswählen</h1>
@ -18,6 +28,9 @@ export function BarPicker({ bars, onPick }: Props) {
</button>
))
)}
<button class="theme-toggle" onClick={toggleTheme}>
{theme === 'dark' ? '☀ Heller Modus' : '🌙 Dunkler Modus'}
</button>
</div>
);
}