# Frontend Components — Unit 2: Shared contact blocks ## Hierarchy ```mermaid graph TD Home["routes/index.tsx"] --> Section["home/ContactSection (heading, URL clean-up, scroll, focus)"] Section --> Panel["ContactPanel (load lazy)"] Panel --> Gate["ContactFormGate"] Gate --> Privacy1["PrivacyNote (under the notice)"] Panel --> Form["ContactForm (lazy chunk or direct)"] Form --> Privacy2["PrivacyNote (under the submit button)"] Details["ContactDetails (used by the contact page in unit 3)"] --> Eyebrow["Eyebrow as h2"] Details --> Row["channel row: icon + link"] classDef page fill:#2196F3,stroke:#0d47a1,color:#000; classDef shared fill:#4CAF50,stroke:#2e7d32,color:#000; classDef small fill:#e2e8f0,stroke:#4a5568,color:#000; class Home,Section page; class Panel,Gate,Form,Details shared; class Privacy1,Privacy2,Eyebrow,Row small; ``` Text alternative: the homepage renders ContactSection, which renders ContactPanel; the panel wraps the form in the gate; both the gate notice and the form show PrivacyNote; ContactDetails (for the contact page) renders an eyebrow-style h2 and one row per channel. ## Components ### `ContactPanel` (new, `components/ContactPanel/`) - **Props**: see [component-methods.md](../../../inception/application-design/component-methods.md). - **State**: `seenPakket`, `preselect { shoot, key }`, `chosenName` (moved from `ContactSection`); `formLoaded` for `lazy`. - **Test ids**: keeps `contact-gate`, `contact-gate-notice`, `contact-gate-mail`, `contact-form*` from the existing components. - **Accessibility**: unchanged (gate uses `inert`; the notice is outside the inert part). ### `home/ContactSection` (changed) - Keeps `TITLE_ID`, heading, `PageSection id="contact"`, the `?pakket=` clean-up effect (navigate replace, hash scroll respecting reduced motion, focus on the heading). - Renders `` inside its `Reveal`. ### `ContactForm` (changed) - New prop `replyTime`; thank-you text per BR-RT-01. - `PrivacyNote` under the submit button (BR-PR-02). ### `ContactFormGate` (changed) - `PrivacyNote` under the mail button in the notice (BR-PR-03), only when the gate is shown. ### `PrivacyNote` (new, small, `components/PrivacyNote/`) - Renders BR-PR-01: `Text` in small size, `ink.soft`, with `Link variant="underline"` + `RouterLink to="/privacyverklaring"`. - Test id: `privacy-note`. ### `ContactDetails` (new, `components/ContactDetails/`) - **Props**: `titleId`, `title`, `email`, `socials`, `portrait?`, `data-testid?`. - **Structure**: a card (`bg` white, border `line`, shadow `panel`); header: optional round portrait (decorative, `alt=""`) next to the h2 (`Eyebrow as="h2"` with `id={titleId}`); a `ul` with `aria-labelledby={titleId}`; one `li` per channel with a link containing the icon (`aria-hidden`) and the label (+ hidden new-tab hint for socials). - **Styling**: rows `minH="44px"`, icon in `accent.deep`, text `ink.soft` → `accent.deep` on hover, theme focus ring (BR-CD-08); all from theme tokens. - **Test ids**: `{testid}` on the card, `contact-details-{kind or platform}` on each link. - **Portrait size and layout variants** are used in unit 3; in this unit the component supports the prop and is tested with and without it. ## Interactions - E-mail row: opens the mail app (`mailto:` with subject). - Social rows: open the profile in a new tab. - Privacy link: in-app navigation to `/privacyverklaring`. - Homepage: unchanged flows ("Boek …" → preselect → URL clean-up → scroll → focus). ## Visible change on existing pages - Homepage contact section: the privacy line under the "Binnenkort" notice (and under the form once enabled). - Footer: Instagram now listed before Facebook (content order, Q1 = A).