Skip to content
SprecherEast
Issue 457

enhancement: The content, call-to-action and archive blocks take plain props (0013)

Back to our plan
Done
enhancementfrontendcmspriority: high

Summary

Move the page builder's own blocks (content, call to action, archive) to plain props, built from the shared components, as decision 0013 says. Editors and visitors see the same pages; the code stops passing raw CMS data into components.

Details

Today ContentBlock, CallToActionBlock and ArchiveBlock take the generated Payload types and hand-build their sections and cards (B8–B11, B13, B16 in docs/ui/). The component set (docs/ui/component-set-modules.md) gives each one plain props and the shared parts:

  • ContentBlock: layout: single, columns, cards, stats (today guessed from the column sizes inside the component; the mapper decides it once), columns ({ size, body, link? }[]). Built from Section, CardGrid, Card, RichText · compact, Button.
  • CallToActionBlock: body, links. Built from Section · brand, RichText · inverse, Button · inverse.
  • ArchiveBlock: intro, posts (loaded by a use case, passed in by app/). Built from Section · surface, CardGrid.

Following 0013:

  • props types in src/modules/site/domain/; to…Props mappers in src/modules/site/data/mappers.ts; links go through resolveLink(), and the ResolvedLink type moves to src/platform/lib/content.ts
  • getPageBySlug returns site's blocks already mapped; the layout union keeps the stored type for blocks other modules own (form, media), which the registry in app/ maps
  • PageBlockComponents stays keyed by blockType, so tsc fails on a missing component

Heroes move in a separate issue.

Acceptance criteria

  • Not done: The three blocks take plain props; none imports @/payload-types.
  • Not done: Each mapper has unit tests (including the layout choice for ContentBlock).
  • Not done: Pages look the same at the six widths in both themes (or each change is listed and follows the card rules).
  • Not done: docs/ui/component-set-modules.md says what exists.

Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab