Functional design, code generation plan and summary of the shared contact blocks, plus the coordination with the parallel features. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3.7 KiB
3.7 KiB
Frontend Components — Unit 2: Shared contact blocks
Hierarchy
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.
- State:
seenPakket,preselect { shoot, key },chosenName(moved fromContactSection);formLoadedforlazy. - 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
<ContactPanel idPrefix="home-contact" load="lazy" ... />inside itsReveal.
ContactForm (changed)
- New prop
replyTime; thank-you text per BR-RT-01. PrivacyNoteunder the submit button (BR-PR-02).
ContactFormGate (changed)
PrivacyNoteunder the mail button in the notice (BR-PR-03), only when the gate is shown.
PrivacyNote (new, small, components/PrivacyNote/)
- Renders BR-PR-01:
Textin small size,ink.soft, withLink variant="underline"+RouterLink to="/privacyverklaring". - Test id:
privacy-note.
ContactDetails (new, components/ContactDetails/)
- Props:
titleId,title,email,socials,portrait?,data-testid?. - Structure: a card (
bgwhite, borderline, shadowpanel); header: optional round portrait (decorative,alt="") next to the h2 (Eyebrow as="h2"withid={titleId}); aulwitharia-labelledby={titleId}; oneliper channel with a link containing the icon (aria-hidden) and the label (+ hidden new-tab hint for socials). - Styling: rows
minH="44px", icon inaccent.deep, textink.soft→accent.deepon 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).