Skip to content

Commit

Permalink
Prevent rendering of container if empty layout
Browse files Browse the repository at this point in the history
  • Loading branch information
woodwoerk committed Sep 27, 2023
1 parent 1c7dcf5 commit 240100f
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions components/contentblocks/CategoryPageHeaderBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,22 +178,23 @@ interface CategoryHeaderAttributesProps extends Pick<Props, 'page'> {
const CategoryHeaderAttributes = ({
layout,
page,
}: CategoryHeaderAttributesProps) => (
<AttributesContainer>
<Attributes>
<Row>
{layout.map((block, i) => (
<CategoryPageStreamField
key={i}
block={block}
page={page}
context="hero"
/>
))}
</Row>
</Attributes>
</AttributesContainer>
);
}: CategoryHeaderAttributesProps) =>
layout.length ? (
<AttributesContainer>
<Attributes>
<Row>
{layout.map((block, i) => (
<CategoryPageStreamField
key={i}
block={block}
page={page}
context="hero"
/>
))}
</Row>
</Attributes>
</AttributesContainer>
) : null;

interface LegacyCategoryHeaderAttributesProps
extends Pick<Props, 'attributes' | 'categoryId' | 'typeId'> {
Expand Down

0 comments on commit 240100f

Please sign in to comment.