Files
AndreaSlopFotografie/aidlc-docs/features/contact-page/construction/contact-page/functional-design/frontend-components.md
T
SluijsensandClaude Opus 5.5 9c2601d846 Records unit 3 of the Contact page as generated
Functional design, code generation plan and summary of the contact page,
the updated LAYOUT.md diagram and the extended link requirement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 19:27:18 +01:00

3.3 KiB
Raw Blame History

Frontend Components — Unit 3: Contact page

Hierarchy

graph TD
    Route["routes/contact.tsx"] --> Intro["PageIntro: eyebrow, h1, intro"]
    Route --> Section["PageSection flushTop, labelled by the form heading"]
    Section --> NarrowCard["ContactDetails with portrait (below lg)"]
    Section --> Grid["Grid: one column, two from lg"]
    Grid --> FormCol["Form column: hidden h2 + ContactPanel eager"]
    Grid --> Aside["contact/ContactAside (from lg)"]
    Aside --> Photo["picture: photo from lg only"]
    Aside --> WideCard["ContactDetails (overlapping the photo)"]
    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 Route,Section,Grid,FormCol page;
    class Intro,NarrowCard,WideCard,Aside shared;
    class Photo small;

Text alternative: the contact route renders PageIntro and one PageSection; inside it the narrow-screen card, then a grid with the form column and, from lg, ContactAside with the photo and the wide-screen card.

routes/contact.tsx

  • validateSearch keeps pakket when it is a string; head per the business logic model.
  • Effect: when pakket is defined, navigate({ to: '/contact', search: {}, replace: true, resetScroll: false }).
  • Renders PageIntro with withReplyTime(head.intro, replyTime), then the section.
  • Section: PageSection labelledBy="contact-form-title" spacing="flushTop" data-testid="contact-page".
  • Narrow card: wrapper display={{ base: 'block', lg: 'none' }}, ContactDetails titleId="contact-details-narrow" portrait={portrait} data-testid="contact-details-narrow", margin below it.
  • Grid: templateColumns={{ base: '1fr', lg: '3fr 2fr' }}, gap as MediaText (clamp(2rem, 6vw, 5.5rem)), alignItems="start".
  • Form column: VisuallyHidden h2 with id="contact-form-title", then ContactPanel idPrefix="contact" load="eager" with the route's pakket.
  • Test ids: contact-page, contact-details-narrow, contact-details-wide, contact-aside, contact-aside-photo.

components/contact/ContactAside

  • Props: image: ContentImage, children: ReactNode (the card).
  • Wrapper display={{ base: 'none', lg: 'block' }}, position="relative", padding below the photo for the overlapping card.
  • chakra.picture with <source media="(min-width: 64em)" srcSet={image.src}> and an img with a 1×1 transparent data: GIF as src, alt={image.alt}, intrinsic width/height, fetchPriority="high", decoding="async", aspect ratio 4:5, objectFit="cover", background paper.deep while loading.
  • Card position: absolutely placed over the bottom of the photo with side insets (left/right ≈ 1.5rem, bottom 0), as in the mockup.

Responsive behaviour

Width What shows
< 480 px intro, card with portrait, form (name and e-mail stacked)
480–1023 px same, name and e-mail side by side
≥ 1024 px intro, form left, photo with card right

Accessibility

  • Reading and tab order: intro → (narrow card) → form → (wide card); hidden variants are display: none.
  • The visually hidden form heading names the section; the cards each have a labelled list.
  • Photo alt text describes the photo; portrait decorative.