Replaces em dashes with en dashes across all hardcoded copy, emails, and seed content, then reworks the site's visual language so it reads as deliberately designed rather than assembled from generic components: - New ArrowLink component replaces ad hoc "Mehr erfahren ->" links and ghost buttons; one shared FormField (TextField/TextAreaField) replaces 7 near-duplicate field styles across every form - Navbar loses its glassmorphism blur for a solid warm background, gets a subtle active-link underline and a softer, warmer mega-menu - PageHeader supports per-page blob tone/position and a compact mode instead of an identical band on every interior page - Homepage: the core offer is featured large instead of four equal cards, the philosophy section gets a single calmer accent blob, blog teasers now show their cover image like the real /aktuelles page does - Booking calendar and widget: 44px touch targets throughout (month nav, day cells, time slots, cancel action), a visible "today" ring, and responsive padding so the calendar isn't cramped on small screens - Quieter, warmer empty states on /termine and /aktuelles No functional changes: all interaction logic (nav menus, forms, booking, CMS data fetching) is untouched, only markup and styling.
50 lines
1.7 KiB
TypeScript
50 lines
1.7 KiB
TypeScript
"use client";
|
|
|
|
import { useState, type FormEvent } from "react";
|
|
import { useRouter } from "next/navigation";
|
|
import { TextField } from "@/components/FormField";
|
|
|
|
export function ProfileForm({ id, name, phone }: { id: number; name: string; phone: string }) {
|
|
const router = useRouter();
|
|
const [status, setStatus] = useState<"idle" | "saving" | "saved" | "error">("idle");
|
|
|
|
async function handleSubmit(e: FormEvent<HTMLFormElement>) {
|
|
e.preventDefault();
|
|
setStatus("saving");
|
|
const data = new FormData(e.currentTarget);
|
|
|
|
const res = await fetch(`/api/customers/${id}`, {
|
|
method: "PATCH",
|
|
credentials: "include",
|
|
headers: { "Content-Type": "application/json" },
|
|
body: JSON.stringify({
|
|
name: String(data.get("name") ?? ""),
|
|
phone: String(data.get("phone") ?? "") || null,
|
|
}),
|
|
});
|
|
|
|
if (res.ok) {
|
|
setStatus("saved");
|
|
router.refresh();
|
|
} else {
|
|
setStatus("error");
|
|
}
|
|
}
|
|
|
|
return (
|
|
<form onSubmit={handleSubmit} className="space-y-5">
|
|
<TextField label="Name" id="name" name="name" type="text" required defaultValue={name} />
|
|
<TextField label="Telefonnummer (optional)" id="phone" name="phone" type="tel" defaultValue={phone} />
|
|
<button
|
|
type="submit"
|
|
disabled={status === "saving"}
|
|
className="rounded-full bg-anouma-mauve-dark px-7 py-3 text-sm font-medium text-white hover:bg-anouma-plum disabled:opacity-60"
|
|
>
|
|
{status === "saving" ? "Wird gespeichert …" : "Speichern"}
|
|
</button>
|
|
{status === "saved" && <p className="text-sm text-anouma-olive">Gespeichert.</p>}
|
|
{status === "error" && <p className="text-sm text-red-700">Speichern fehlgeschlagen.</p>}
|
|
</form>
|
|
);
|
|
}
|