Skip to content

Commit b51abdc

Browse files
committed
fix: action references spacing if no references exists
1 parent dec550b commit b51abdc

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/components/PageBlockRenderer.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,13 @@ const pageBlockRenderers: Partial<Record<PageBlock["blockType"], BlockRenderer>>
9494
)
9595
},
9696
actionReferences: (block, options) => {
97+
const references = options.actionReferences ?? []
98+
if (references.length === 0) return null
99+
97100
const content = block as Extract<PageBlock, { blockType: "actionReferences" }>
98101
return (
99102
<ActionReferencesSection
100-
references={options.actionReferences ?? []}
103+
references={references}
101104
locale={options.locale ?? "en"}
102105
sectionHeading={content.sectionHeading}
103106
sectionLayout={content.sectionLayout}

src/components/sections/ActionEventsSection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ interface ActionEventsSectionProps {
1414
export function ActionEventsSection({ moduleJson, sectionHeading, sectionLayout, sectionDescription, sectionLinkButton }: ActionEventsSectionProps) {
1515
const events = extractFlowTypesFromJson(moduleJson)
1616
if (!events.length) return null
17+
1718
const columnCount = Math.min(events.length, 3)
1819
const columns = Array.from({ length: columnCount }, (_, columnIndex) => events.filter((_, itemIndex) => itemIndex % columnCount === columnIndex))
1920

src/components/sections/ActionReferencesSection.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ interface ActionReferencesSectionProps {
1414

1515
export function ActionReferencesSection({ references, locale, sectionHeading, sectionLayout, sectionDescription, sectionLinkButton }: ActionReferencesSectionProps) {
1616
if (!references.length) return null
17+
1718
return (
1819
<Section heading={sectionHeading} description={sectionDescription} funnelType={sectionLayout ?? "left"} linkButton={sectionLinkButton} className="w-full">
1920
<div className="grid gap-4 md:grid-cols-2">

0 commit comments

Comments
 (0)