diff --git a/app/(marketing)/how-it-works/_components/HowItWorksGuideBody.tsx b/app/(marketing)/how-it-works/_components/HowItWorksGuideBody.tsx index 798591b..bf302bc 100644 --- a/app/(marketing)/how-it-works/_components/HowItWorksGuideBody.tsx +++ b/app/(marketing)/how-it-works/_components/HowItWorksGuideBody.tsx @@ -12,6 +12,7 @@ import { import { asHowItWorksGuideBlock, formatHowItWorksByline, + HOW_IT_WORKS_RULE_CARD_ID, howItWorksReadMinutes, howItWorksWikiMarkdown, type HowItWorksGuideBlock, @@ -149,7 +150,7 @@ function TeamRuleFigure({ const { teamRule } = page; return (
@@ -203,23 +204,26 @@ function GuideBlockView({ if (block.type === "ruleFigure") { return ; } - const wikiMarkdown = howItWorksWikiMarkdown( - page.banner.title, - page.banner.description, - shareUrl, - ); - const mailtoHref = `mailto:?subject=${encodeURIComponent(page.banner.title)}&body=${encodeURIComponent(`${page.banner.title}\n${shareUrl}`)}`; - return ( - - ); + if (block.type === "shareRow") { + const wikiMarkdown = howItWorksWikiMarkdown( + page.banner.title, + page.banner.description, + shareUrl, + ); + const mailtoHref = `mailto:?subject=${encodeURIComponent(page.banner.title)}&body=${encodeURIComponent(`${page.banner.title}\n${shareUrl}`)}`; + return ( + + ); + } + return null; } export default function HowItWorksGuideBody({ @@ -241,25 +245,34 @@ export default function HowItWorksGuideBody({

- {page.sections.map((section) => ( -
-

- {section.heading} -

- {section.blocks.map((block, index) => ( - - ))} -
- ))} + {page.sections.map((section) => { + const blocks = section.blocks.flatMap((block) => { + const guideBlock = asHowItWorksGuideBlock(block); + return guideBlock ? [guideBlock] : []; + }); + const hasCopy = blocks.some((block) => block.type !== "shareRow"); + return ( +
+ {hasCopy ? ( +

+ {section.heading} +

+ ) : null} + {blocks.map((block, index) => ( + + ))} +
+ ); + })}