import { useSettings } from "@/store/settings"; import { Switch, useIsTouch } from "@/ui/misc"; import { SWIPE_CHOICES, type SwipeAction } from "@/lib/swipe"; import { UI_LANGUAGES } from "@/lib/languages"; import { t as translate } from "@/lib/i18n"; /** * The theme cards, each previewing the background it actually paints. Kept as * data rather than three inline ternaries so a fourth does not mean editing a * conditional in three places. */ const THEMES = [ { id: "system", label: "Match system", preview: "linear-gradient(90deg,#f6f8fa 50%,#0b1220 50%)" }, { id: "light", label: "Light", preview: "#f6f8fa" }, { id: "dark", label: "Dark", preview: "#0b1220" }, // The ihasmail.org palette: its background, with its teal and the logo's // orange showing, so the card looks like what picking it does. { id: "ihasmail", label: "ihasmail", preview: "linear-gradient(135deg,#0d2430 0%,#12303e 55%,#46cac3 55%,#46cac3 78%,#f9a34b 78%)" }, ] as const; const ACCENTS = [ { id: "teal", color: "#0f766e" }, { id: "blue", color: "#2563eb" }, { id: "purple", color: "#7c3aed" }, { id: "rose", color: "#e11d48" }, { id: "orange", color: "#ea580c" }, { id: "green", color: "#16a34a" }, ]; export function AppearanceSettings() { const s = useSettings((st) => st.settings); const update = useSettings((st) => st.update); const isTouch = useIsTouch(); return (

{translate("Appearance")}

{translate("Make ihasmail yours.")}

{translate("Theme")}

{THEMES.map((t) => ( ))}

{translate("ihasmail")} {translate("is the palette from")} {translate("ihasmail.org")}{translate(", and what a new account starts on. It is a dark theme, so it counts as dark wherever that matters, and the accent colour below still applies on top of it.")}

update({ themeMessageBody: v })} label={translate("Apply the theme to messages too")} hint={translate("Plain-text mail already follows the theme. With this on, HTML mail that brings no colours of its own does as well, instead of sitting on a white card. Messages that style themselves are left exactly as the sender designed them.")} />

{translate("Accent color")}

{ACCENTS.map((a) => (

{translate("Density & text")}

{translate("Language")}

{/* Said plainly rather than left to be discovered. A picker with one entry looks broken; a picker with one entry and a sentence explaining that more are coming is a roadmap. */}

{translate("Only languages ihasmail has been translated into appear here, so this list grows as translations land rather than ahead of them — a language offered without strings behind it would leave the page claiming to be in a language it is not.")}

{translate("This is separate from")} {translate("Language & region")} {translate("in General, which decides how dates, times and numbers are written. You can read an English interface with German dates, or the other way round.")}

{translate("Swiping")}

{translate("On a touchscreen, drag a message sideways to act on it. Each direction can do one thing, or nothing. These follow your account, so a phone and a tablet agree; a mouse ignores them and keeps dragging messages into folders instead.")}

{/* Said once, where it is relevant, rather than greying the pickers out on a desktop: the settings are real and worth setting here for the phone that will read them, and a disabled control invites a hunt for whatever would enable it. */} {!isTouch && (

{translate("This screen has no touchscreen, so nothing here changes what it does. Your phone or tablet will pick these up.")}

)}

{translate("Holding a message selects it, and holding a folder opens its menu. Pull the top of the message list down to check for new mail.")}

{translate("Sidebar")}

update({ labelsSidebar: v })} label={translate("Show labels in the sidebar")} /> update({ showHiddenFolders: v })} label={translate("Show unsubscribed (hidden) folders")} /> update({ sidebarCollapsed: v })} label={translate("Collapse sidebar to icons")} />
); }