Issue 460
tech-debt: Page-builder heroes take plain props (PageHero)
Back to our planDone
frontendtech-debtpriority: medium
Summary
Bring the three page-builder heroes (high, medium, low impact) into one PageHero component that takes plain props mapped from the CMS, as decision 0013 says. Editors and visitors see the same pages; the hero code stops reading raw CMS data.
Details
Today HighImpactHero, MediumImpactHero and LowImpactHero each take the generated Page['hero'] type, and RenderHero picks one (H1, H4, H5 in docs/ui/). The component set (docs/ui/component-set-modules.md, row PageHero) gives them one component:
PageHero:variant:high,medium,low;titleandbody(RichTextValue),image(ImageRef),links(ResolvedLink[]). Built fromMedia,RichTextandButton(LinkButton).
Following 0013, as #457 did for the blocks:
PageHeroPropsinsrc/modules/site/domain/;toPageHeroPropsinsrc/modules/site/data/mappers.ts, links throughresolveLink()getPageBySlugreturns the hero already mapped (nonemaps to no hero)- the CMS hero field config (
src/modules/site/cms/hero.ts) doesn't change, so editors see no difference
The standalone post and event heroes move separately (they become PageHeader · image).
Acceptance criteria
- Not done: One
PageHerowith the three variants replaces the three hero components andRenderHero; it doesn't import@/payload-types. - Not done:
toPageHeroPropshas unit tests, including a hero with no image, no links and typenone. - Not done: Home and the low-impact pages look the same at the six widths in both themes (or each change is listed and follows the design rules).
- Not done:
docs/ui/says what exists.
Generated by Claude Code, opens in a new tab