feat(contact): extract shared ContactForm and add per-subdomain contact pages
Refactor the monolithic main-site contact page into a reusable <ContactForm> component that encapsulates the Turnstile widget, cooldown timer, email-verification flow, and tRPC submission. The main /contact route becomes a thin wrapper that supplies the site-specific disclaimer subline and Life-and-Lineage FAQ accordion (now exported as <LineageContactQuestions> for reuse). Add per-subdomain contact routes (gaze, inputhalo, lineage, nessa) that render the shared component, with site-aware subject prefix, recipient, heading, and PageHead metadata derived via useSite() from CONTACT_CONTEXT. Introduce src/lib/contact-config.ts (with tests) centralizing the contact recipient/sender addresses and subject building. The misc.sendContactRequest mutation accepts an optional subjectPrefix (defaulting to "freno.me") so inbound call sites continue emitting byte-identical legacy subjects, while subdomain submissions route distinct subjects (e.g. "[Gaze] Contact Request") to the same inbox.
This commit is contained in:
20
src/routes/gaze/contact.tsx
Normal file
20
src/routes/gaze/contact.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { ContactForm } from "~/components/ContactForm";
|
||||
|
||||
/**
|
||||
* Gaze contact page (`gaze.freno.me/contact`).
|
||||
*
|
||||
* Thin wrapper over the shared `<ContactForm>` (task 09). Site awareness —
|
||||
* subject prefix `[Gaze]`, recipient label, heading, and PageHead metadata —
|
||||
* is derived from `useSite()` inside the component via `CONTACT_CONTEXT.gaze`,
|
||||
* so this route needs no explicit props.
|
||||
*
|
||||
* vercel.json rewrites `gaze.freno.me/*` → the internal `/gaze/*` route
|
||||
* prefix; the browser URL stays `gaze.freno.me/contact`.
|
||||
*
|
||||
* Acceptance: `gaze.localhost:3000/contact` renders the contact form with
|
||||
* Gaze branding; submissions email `michael@freno.me` with subject
|
||||
* `[Gaze] Contact Request`.
|
||||
*/
|
||||
export default function GazeContactPage() {
|
||||
return <ContactForm />;
|
||||
}
|
||||
Reference in New Issue
Block a user