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:
29
src/routes/lineage/contact.tsx
Normal file
29
src/routes/lineage/contact.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import { ContactForm } from "~/components/ContactForm";
|
||||
import { LineageContactQuestions } from "~/routes/contact";
|
||||
|
||||
/**
|
||||
* Life and Lineage contact page (`lineage.freno.me/contact`).
|
||||
*
|
||||
* Thin wrapper over the shared `<ContactForm>` (task 09). Site awareness —
|
||||
* subject prefix `[Lineage]`, recipient label, heading, and PageHead metadata
|
||||
* — is derived from `useSite()` inside the component via
|
||||
* `CONTACT_CONTEXT.lineage`.
|
||||
*
|
||||
* Renders the Life-and-Lineage FAQ accordion (re-imported from the main-site
|
||||
* contact route so the canonical definition lives in one place) above the
|
||||
* form — the lineage subdomain is the natural home for product support Q&A.
|
||||
*
|
||||
* vercel.json rewrites `lineage.freno.me/*` → the internal `/lineage/*` route
|
||||
* prefix; the browser URL stays `lineage.freno.me/contact`.
|
||||
*
|
||||
* Acceptance: `lineage.localhost:3000/contact` renders the contact form with
|
||||
* Life and Lineage branding; submissions email `michael@freno.me` with subject
|
||||
* `[Lineage] Contact Request`.
|
||||
*/
|
||||
export default function LineageContactPage() {
|
||||
return (
|
||||
<ContactForm>
|
||||
<LineageContactQuestions />
|
||||
</ContactForm>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user