Skip to content

Commit bdd1c41

Browse files
committed
fix: buttonwidths & text sizes in actionherosection
1 parent 9344bab commit bdd1c41

4 files changed

Lines changed: 47 additions & 12 deletions

File tree

src/components/PageBlockRenderer.tsx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,35 @@ const pageBlockRenderers: Partial<Record<PageBlock["blockType"], BlockRenderer>>
6262
widehero: (block) => <WideHeroSection content={block as Extract<PageBlock, { blockType: "widehero" }>} />,
6363
listFeature: (block) => <ListFeatureSection content={block as Extract<PageBlock, { blockType: "listFeature" }>} />,
6464
stats: (block) => <StatsSection content={block as Extract<PageBlock, { blockType: "stats" }>} />,
65-
actionHero: (block, options) => options.action ? <ActionHeroSection action={options.action} locale={options.locale ?? "en"} content={block as Extract<PageBlock, { blockType: "actionHero" }>} /> : null,
65+
actionHero: (block, options) =>
66+
options.action ? <ActionHeroSection action={options.action} locale={options.locale ?? "en"} content={block as Extract<PageBlock, { blockType: "actionHero" }>} /> : null,
6667
actionDetails: (block, options) => {
6768
if (!options.action) return null
6869
const content = block as Extract<PageBlock, { blockType: "actionDetails" }>
69-
return <ActionDetailSection action={options.action} moduleJson={options.actionModuleJson} sectionHeading={content.sectionHeading} sectionLayout={content.sectionLayout} sectionDescription={content.sectionDescription} sectionLinkButton={content.sectionLinkButton} flowTypesLabel={content.flowTypesLabel} functionDefinitionsLabel={content.functionDefinitionsLabel} />
70+
return (
71+
<ActionDetailSection
72+
moduleJson={options.actionModuleJson}
73+
sectionHeading={content.sectionHeading}
74+
sectionLayout={content.sectionLayout}
75+
sectionDescription={content.sectionDescription}
76+
sectionLinkButton={content.sectionLinkButton}
77+
flowTypesLabel={content.flowTypesLabel}
78+
functionDefinitionsLabel={content.functionDefinitionsLabel}
79+
/>
80+
)
7081
},
7182
actionReferences: (block, options) => {
7283
const content = block as Extract<PageBlock, { blockType: "actionReferences" }>
73-
return <ActionReferencesSection references={options.actionReferences ?? []} locale={options.locale ?? "en"} sectionHeading={content.sectionHeading} sectionLayout={content.sectionLayout} sectionDescription={content.sectionDescription} sectionLinkButton={content.sectionLinkButton} />
84+
return (
85+
<ActionReferencesSection
86+
references={options.actionReferences ?? []}
87+
locale={options.locale ?? "en"}
88+
sectionHeading={content.sectionHeading}
89+
sectionLayout={content.sectionLayout}
90+
sectionDescription={content.sectionDescription}
91+
sectionLinkButton={content.sectionLinkButton}
92+
/>
93+
)
7494
},
7595
actionList: (block, options) => <ActionListSection actions={options.actions ?? []} locale={options.locale ?? "en"} content={block as Extract<PageBlock, { blockType: "actionList" }>} />,
7696
}

src/components/sections/ActionDetailSection.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import { ActionTriggerCard } from "@/components/ActionTriggerCard"
2-
import { extractFlowTypesFromJson, extractFunctionDefinitionsFromJson } from "@/lib/actionExtraction"
3-
import type { ActionItem } from "@/lib/cms"
4-
import type { ReactNode } from "react"
52
import { Section } from "@/components/ui/Section"
3+
import { extractFlowTypesFromJson, extractFunctionDefinitionsFromJson } from "@/lib/actionExtraction"
64
import { cn } from "@/lib/utils"
5+
import type { ReactNode } from "react"
76

87
interface ActionDetailSectionProps {
9-
action: ActionItem
108
moduleJson: unknown
119
sectionHeading?: string | null
1210
sectionLayout?: "center" | "left" | null
@@ -16,7 +14,7 @@ interface ActionDetailSectionProps {
1614
functionDefinitionsLabel: string
1715
}
1816

19-
export function ActionDetailSection({ action, moduleJson, sectionHeading, sectionLayout, sectionDescription, sectionLinkButton, flowTypesLabel, functionDefinitionsLabel }: ActionDetailSectionProps) {
17+
export function ActionDetailSection({ moduleJson, sectionHeading, sectionLayout, sectionDescription, sectionLinkButton, flowTypesLabel, functionDefinitionsLabel }: ActionDetailSectionProps) {
2018
const flowTypes = extractFlowTypesFromJson(moduleJson)
2119
const functionDefinitions = extractFunctionDefinitionsFromJson(moduleJson)
2220
if (!flowTypes.length && !functionDefinitions.length) return null

src/components/sections/ActionHeroSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function ActionHeroSection({ action, locale, content }: { action: ActionI
4444
)}
4545
</StaggerItem>
4646
)}
47-
<StaggerItem as="h1" className="text-balance text-3xl font-bold text-white lg:text-5xl">
47+
<StaggerItem as="h1" className="text-balance text-3xl font-bold text-white lg:text-4xl">
4848
{heading}
4949
</StaggerItem>
5050
{description && (
@@ -53,7 +53,7 @@ export function ActionHeroSection({ action, locale, content }: { action: ActionI
5353
</StaggerItem>
5454
)}
5555
{buttons.length > 0 && (
56-
<StaggerItem className="mt-4 flex flex-col gap-2 sm:flex-row sm:gap-4">
56+
<StaggerItem className="mt-4 flex flex-col gap-2 sm:gap-4">
5757
{buttons.map((button, index) => (
5858
<HapticButtonLink
5959
key={`${button.label}-${index}`}

src/components/sections/ActionReferencesSection.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,24 @@ import type { ActionItem } from "@/lib/cms"
33
import type { AppLocale } from "@/lib/i18n"
44
import { Section } from "@/components/ui/Section"
55

6-
export function ActionReferencesSection({ references, locale, sectionHeading, sectionLayout, sectionDescription, sectionLinkButton }: { references: ActionItem[]; locale: AppLocale; sectionHeading?: string | null; sectionLayout?: "center" | "left" | null; sectionDescription?: string | null; sectionLinkButton?: { label?: string | null; url?: string | null } | null }) {
6+
interface ActionReferencesSectionProps {
7+
references: ActionItem[]
8+
locale: AppLocale
9+
sectionHeading?: string | null
10+
sectionLayout?: "center" | "left" | null
11+
sectionDescription?: string | null
12+
sectionLinkButton?: { label?: string | null; url?: string | null } | null
13+
}
14+
15+
export function ActionReferencesSection({ references, locale, sectionHeading, sectionLayout, sectionDescription, sectionLinkButton }: ActionReferencesSectionProps) {
716
if (!references.length) return null
8-
return <Section heading={sectionHeading} description={sectionDescription} funnelType={sectionLayout ?? "left"} linkButton={sectionLinkButton} className="w-full"><div className="grid gap-4 md:grid-cols-2">{references.map((reference) => <ActionCard key={reference.id} action={reference} locale={locale} />)}</div></Section>
17+
return (
18+
<Section heading={sectionHeading} description={sectionDescription} funnelType={sectionLayout ?? "left"} linkButton={sectionLinkButton} className="w-full">
19+
<div className="grid gap-4 md:grid-cols-2">
20+
{references.map((reference) => (
21+
<ActionCard key={reference.id} action={reference} locale={locale} />
22+
))}
23+
</div>
24+
</Section>
25+
)
926
}

0 commit comments

Comments
 (0)