Fix mail layouts, /invite form-reset, profile validation
Mail templates (6 templates touched): - New shared `_styles.ts` exports a robust font stack starting with Arial/Helvetica so mail readers that lack -apple-system and BlinkMacSystemFont don't fall back to Monospace (observed in at least one webmail client). - `fontFamily` is now set on every text-bearing element, not only on `<Body>`, because some clients (Outlook, several webmail readers) do not inherit body CSS into nested sections. - ASCII substitutions are gone: "Ueber" → "Über", "fuer" → "für", "bestaetigen" → "bestätigen", "uebernehmen" → "übernehmen", "verlaesslich" → "verlässlich". - InviteEmail + NewsEmail buttons switch from the off-brand yellow (#f0b84b) to the brand dark green so the CTA matches the header. /invite form: - InviteState gains an `attempt` counter plus echoed checkbox `values`, mirroring the /register and /onboarding fix from earlier branches. A failed submit no longer wipes the Datenschutz / Adressbuch-Opt-In ticks. Passwords stay empty for security. - Field error <p> elements gain role="alert" + aria-live="polite" so screen readers announce validation failures on submit. Inputs use aria-describedby to link to error / helper text. Profile validation: - Telephone numbers must match a permissive pattern that still rejects obvious garbage (previously "abc-123-not-a-phone" was accepted). - Postal codes must match an alphanumeric pattern of 3–10 chars (previously "ABCDE" was accepted). - Child date-of-birth is now validated via superRefine: it must be a parseable date, not in the future, and not before 1900. Previously a kid born in 2030 was accepted. - The three Profil server actions now surface the first Zod issue message instead of generic "Ungültige Eingabedaten." toasts. Misc: - "fuer" → "für" in the Adressbuch page subtitle. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
contactRequestTypeLabels,
|
||||
type ContactRequestInput,
|
||||
} from "@/lib/contact-schema";
|
||||
import { fontStack } from "./_styles";
|
||||
|
||||
type ContactRequestEmailProps = ContactRequestInput;
|
||||
|
||||
@@ -72,14 +73,14 @@ function InfoRow({ label, value }: { label: string; value: string }) {
|
||||
const body = {
|
||||
margin: 0,
|
||||
backgroundColor: "#f8faf8",
|
||||
fontFamily:
|
||||
'-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
||||
fontFamily: fontStack,
|
||||
};
|
||||
|
||||
const container = {
|
||||
margin: "0 auto",
|
||||
padding: "32px 24px",
|
||||
maxWidth: "620px",
|
||||
fontFamily: fontStack,
|
||||
};
|
||||
|
||||
const heading = {
|
||||
@@ -87,6 +88,7 @@ const heading = {
|
||||
color: "#0f172a",
|
||||
fontSize: "28px",
|
||||
lineHeight: "34px",
|
||||
fontFamily: fontStack,
|
||||
};
|
||||
|
||||
const intro = {
|
||||
@@ -94,6 +96,7 @@ const intro = {
|
||||
color: "#475569",
|
||||
fontSize: "15px",
|
||||
lineHeight: "24px",
|
||||
fontFamily: fontStack,
|
||||
};
|
||||
|
||||
const details = {
|
||||
@@ -101,6 +104,7 @@ const details = {
|
||||
borderRadius: "10px",
|
||||
backgroundColor: "#ffffff",
|
||||
padding: "18px",
|
||||
fontFamily: fontStack,
|
||||
};
|
||||
|
||||
const row = {
|
||||
@@ -108,6 +112,7 @@ const row = {
|
||||
color: "#0f172a",
|
||||
fontSize: "15px",
|
||||
lineHeight: "22px",
|
||||
fontFamily: fontStack,
|
||||
};
|
||||
|
||||
const messageBox = {
|
||||
@@ -116,6 +121,7 @@ const messageBox = {
|
||||
borderRadius: "10px",
|
||||
backgroundColor: "#ffffff",
|
||||
padding: "18px",
|
||||
fontFamily: fontStack,
|
||||
};
|
||||
|
||||
const label = {
|
||||
@@ -125,6 +131,7 @@ const label = {
|
||||
fontWeight: 700,
|
||||
letterSpacing: "0.04em",
|
||||
textTransform: "uppercase" as const,
|
||||
fontFamily: fontStack,
|
||||
};
|
||||
|
||||
const messageText = {
|
||||
@@ -133,6 +140,7 @@ const messageText = {
|
||||
fontSize: "15px",
|
||||
lineHeight: "24px",
|
||||
whiteSpace: "pre-wrap" as const,
|
||||
fontFamily: fontStack,
|
||||
};
|
||||
|
||||
const footer = {
|
||||
@@ -140,4 +148,5 @@ const footer = {
|
||||
color: "#64748b",
|
||||
fontSize: "13px",
|
||||
lineHeight: "20px",
|
||||
fontFamily: fontStack,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user