mirror of
https://github.com/complexcaresolutions/frontend.porwoll.de.git
synced 2026-03-17 16:23:41 +00:00
fix: read CTA from cta group field instead of flat ctaLabel/ctaLink
The CMS hero-block sends CTA data as a nested group (cta.text, cta.link) but the component was reading flat fields (ctaLabel, ctaLink). Falls back to the old field names for backwards compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8d5e687a87
commit
802f58ad17
1 changed files with 3 additions and 2 deletions
|
|
@ -13,8 +13,9 @@ export function HeroBlock({ block }: HeroBlockProps) {
|
||||||
const subheadline = (block.subline as string) || (block.subheadline as string) || (block.subtitle as string) || ''
|
const subheadline = (block.subline as string) || (block.subheadline as string) || (block.subtitle as string) || ''
|
||||||
const backgroundMedia = block.backgroundImage as Record<string, unknown> | undefined
|
const backgroundMedia = block.backgroundImage as Record<string, unknown> | undefined
|
||||||
const backgroundUrl = backgroundMedia?.url as string | undefined
|
const backgroundUrl = backgroundMedia?.url as string | undefined
|
||||||
const ctaLabel = (block.ctaLabel as string) || (block.buttonText as string) || ''
|
const cta = block.cta as Record<string, unknown> | undefined
|
||||||
const ctaLink = (block.ctaLink as string) || (block.buttonLink as string) || ''
|
const ctaLabel = (cta?.text as string) || (block.ctaLabel as string) || ''
|
||||||
|
const ctaLink = (cta?.link as string) || (block.ctaLink as string) || ''
|
||||||
const overlayStyle = (block.overlayStyle as string) || 'dark'
|
const overlayStyle = (block.overlayStyle as string) || 'dark'
|
||||||
const alignment = (block.alignment as string) || 'center'
|
const alignment = (block.alignment as string) || 'center'
|
||||||
const fullHeight = block.fullHeight !== false
|
const fullHeight = block.fullHeight !== false
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue