Shows the three live packages as cards with their price and what is included. Each card links to the contact section with ?pakket=<id>, so the contact form can preselect it. Invalid packages from the CMS are skipped and the pakket value is only accepted when it names a package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3.3 KiB
3.3 KiB
Frontend Components — Unit 3: Prijzen
Hierarchy
graph TD
Route["routes/index.tsx"] --> Pricing["home/Pricing"]
Pricing --> Section["HomeSection"]
Pricing --> Deco["Decorations x2"]
Pricing --> Heading["SectionHeading"]
Pricing --> Card["home/Pricing/PriceCard x n"]
Card --> Link["Book link: Chakra Link with linkButton style around RouterLink"]
Lib["lib: formatPrice, visiblePackages, bookLabel"] -.-> Pricing
Lib -.-> Card
classDef root fill:#4CAF50,stroke:#2e7d32,stroke-width:1px,color:#000;
classDef ui fill:#2196F3,stroke:#0d47a1,stroke-width:1px,color:#000;
classDef logic fill:#9C27B0,stroke:#4a148c,stroke-width:1px,color:#000;
class Route root;
class Pricing,Section,Deco,Heading,Card,Link ui;
class Lib logic;
Text alternative: the home route renders Pricing, which uses HomeSection, two decorations, SectionHeading and one PriceCard per shown package; each card has a book link; the pure helpers supply the shown packages, prices and link labels.
Pricing
- Props:
{ content: HomeContent['pricing']; packages: PricingPackage[] } - Behaviour: renders
visiblePackages(packages); if none remain, the section is not rendered at all (no empty heading). - Layout:
HomeSectiononpaper(plain),data-testid="pricing", heading centred with lead. Cards in a grid: 1 column, centred, max 460 px belowlg; 3 columns fromlg; gapgridGap. - Decorations: two decorative images (
alt="",aria-hidden), absolutely positioned (top-left 8% / 2%, bottom-right 6% / 3%),clamp(90px, 10vw, 160px)wide, opacity 0.55, behind the content, not clickable; loaded deferred. - Reveal: heading and each card fade in, cards staggered by 0.08 s.
PriceCard
- Props:
{ pkg: PricingPackage } - Markup:
articlewithh3(name), price paragraph,ulof features, book link.data-testid="price-card-<id>", linkdata-testid="price-card-<id>-book". - Style: white background, 1 px
lineborder, centred text, paddingclamp(2rem, 3.5vw, 3rem) clamp(1.5rem, 3vw, 2.5rem); name in heading font 1.75 rem; price in heading font 2.25 rem,accent.deep(contrast, NFR-HP-01); features small textink.softbetween two hairlines, gap 0.75 rem; link aligned to the bottom (cards in a row get equal button positions). - Hover (whole card, decorative): lift 6 px,
accentborder,shadow-md; transitioninteraction; no lift under reduced motion. - Book link: the outline
linkButtonstyle; text perbookLabel(BR-BOOK-02) withVisuallyHiddenfor the hidden part;white-space: nowrap; horizontal padding 1.25 rem on phones, the design's 2.4 rem fromsm(BR-BOOK-03). Target/withsearch={{ pakket: id }}andhash="contact".
Route (/)
validateSearch:{ pakket?: string }— keeps a string, drops anything else (BR-PARAM-01, first half).- Passes
homeContent.pricingandpackagestoPricing. Resolving and applying the value, and removing it from the URL, follow in unit 5.
Accessibility (NFR-HP-01)
- Region named by the h2 "Prijzen"; each card has an h3; features are a real list.
- Every link has a unique accessible name containing the package name.
- Decorations are hidden from assistive technology.
- Focus ring from the theme on the link; touch target ≥ 44 px high.