Skip to content

Commit

Permalink
Fix category link, hide icon category if there is no other icon or no…
Browse files Browse the repository at this point in the history
… category
  • Loading branch information
Studio384 committed Feb 18, 2024
1 parent 327f71d commit 2f6e2ae
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions docs/src/app/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,25 +285,27 @@ export default function Icon() {
</Box>
</Box>
</Stack>
<Stack gap={2}>
<Typography level="h3">
More icons in{' '}
<Link color="primary" onClick={() => navigate({ pathname: '/icons', search: `?${createSearchParams({ category: firstCategory })}` })}>
{firstCategory}
</Link>
</Typography>
<Box
sx={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fill, minmax(min(9rem, 100%), 1fr))',
gap: { xs: 1 }
}}
>
{categoryIcons.slice(0, 28).map((icon: ILibraryIcon) => (
<IconCard key={icon.slug} icon={icon} />
))}
</Box>
</Stack>
{firstCategory && categoryIcons.length >= 1 && (
<Stack gap={2}>
<Typography level="h3">
More icons in{' '}
<Link color="primary" onClick={() => navigate({ pathname: '/icons', search: `?${createSearchParams({ category: firstCategory })}` })}>
{firstCategory}
</Link>
</Typography>
<Box
sx={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fill, minmax(min(9rem, 100%), 1fr))',
gap: { xs: 1 }
}}
>
{categoryIcons.slice(0, 28).map((icon: ILibraryIcon) => (
<IconCard key={icon.slug} icon={icon} />
))}
</Box>
</Stack>
)}
</Stack>
</Container>
</>
Expand Down

0 comments on commit 2f6e2ae

Please sign in to comment.