freezmo/components/ThemeSection.tsx
Martin Dvorak ff58fdd71d New Aero background (Gemini-made), old credit removed
The scene is the user's own Frutiger Aero image now: green hills, a river,
an eco-city, bubbles and daisies. Re-encoded to public/aero/background.webp
(152 kB) with a fresh 3 kB pre-blurred variant for the glass, and the
WallpaperSafari credit line, its i18n keys and the README credit are gone
(the image is made by the user with Gemini).

Contrast: 0 below-minimum findings and 0 axe violations, all three themes.
Version 0.2.8, SW -> freezmo-v60.
2026-10-13 08:10:05 +00:00

48 lines
1.5 KiB
TypeScript

"use client";
import { useTheme, type Theme } from "@/lib/theme";
import { haptic } from "@/lib/haptics";
import { useI18n } from "@/lib/i18n";
const OPTIONS: Array<{ id: Theme; labelKey: string }> = [
{ id: "light", labelKey: "common.lightMode" },
{ id: "dark", labelKey: "common.darkMode" },
{ id: "aero", labelKey: "theme.aero" },
];
/**
* The theme picker: light, dark, or Frutiger Aero. Aero is not a dark/light
* variant — it swaps the whole palette and scene — which is why the light/dark
* toggles (header, rail, chat header) disappear while it is on.
*/
export function ThemeSection() {
const { theme, setTheme } = useTheme();
const { t } = useI18n();
return (
<section className="mb-4 space-y-3 rounded-2xl border border-[var(--hairline)] bg-[var(--surface-sunken)] p-3">
<h3 className="text-sm font-semibold text-frost-950 dark:text-frost-50">{t("settings.theme")}</h3>
<div className="segmented" role="group" aria-label={t("settings.theme")}>
{OPTIONS.map((option) => (
<button
key={option.id}
type="button"
aria-pressed={theme === option.id}
onClick={() => {
haptic("toggle");
setTheme(option.id);
}}
>
<span className="seg-label">{t(option.labelKey)}</span>
</button>
))}
</div>
{theme === "aero" ? (
<>
<p className="text-[11px] leading-snug text-[var(--text-subtle)]">{t("theme.aeroNote")}</p>
</>
) : null}
</section>
);
}