Skip to content

Commit

Permalink
Hide empty sections
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-kl1 committed Feb 2, 2025
1 parent 0801713 commit 7700bfc
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/components/SponsorList/SponsorListByType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,17 @@ const SponsorListByType = ({ items }: { items: SponsorProps[] }) => {
return (
<div className="my-10">
{sponsorTypes.map((sponsorType, index) => (
<div id={sponsorType} key={index}>
{renderSponsorSection(
sponsorType,
sponsorListByType[sponsorType],
isDisplayByType(displayByType) ? displayByType[sponsorType] : 'grid'
)}
</div>
<div
key={index}
id={sponsorType}
className={sponsorListByType[sponsorType].length > 0 ? '' : 'hidden'}
>
{renderSponsorSection(
sponsorType,
sponsorListByType[sponsorType],
isDisplayByType(displayByType) ? displayByType[sponsorType] : 'grid'
)}
</div>
))}
</div>
);
Expand Down

0 comments on commit 7700bfc

Please sign in to comment.