Skip to content

Commit 450e095

Browse files
committed
Hide empty sections
1 parent c70eab0 commit 450e095

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

cheatsheet/src/pages/cheatsheet.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ const CheatsheetPage = () => {
3333

3434
const Cheatsheet = () => (
3535
<div className="p-2 gap-2 xl:p-4 xl:gap-4 columns-1 md:columns-2 xl:columns-3 xl:max-w-[1600px] xl:mx-auto">
36-
{cheatsheetInfo.sections.map((section) => (
37-
<CheatsheetSection>
38-
<CheatsheetListComponent section={section} />
39-
</CheatsheetSection>
40-
))}
36+
{cheatsheetInfo.sections
37+
.filter((section) => section.items.length > 0)
38+
.map((section) => (
39+
<CheatsheetSection>
40+
<CheatsheetListComponent section={section} />
41+
</CheatsheetSection>
42+
))}
4143
<CheatsheetSection>
4244
<CheatsheetLegendComponent data={cheatsheetLegend} />
4345
</CheatsheetSection>

0 commit comments

Comments
 (0)