Skip to content

Commit ec86789

Browse files
committed
fix: handle > 6 items in footer nav
1 parent 5045dd4 commit ec86789

File tree

1 file changed

+12
-10
lines changed
  • src/modules/layout/components/footer-nav

1 file changed

+12
-10
lines changed

src/modules/layout/components/footer-nav/index.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,27 @@ const FooterNav = () => {
2121
<div className="flex flex-col gap-y-2">
2222
<span className="text-base-semi">Categories</span>
2323
<ul
24-
className={clsx("grid grid-cols-1 gap-y-2", {
25-
"grid-cols-2": (product_categories?.length || 0) > 4,
24+
className={clsx("grid grid-cols-1 gap-2", {
25+
"grid-cols-2": (product_categories?.length || 0) > 3,
2626
})}
2727
>
28-
{collections?.map((c) => (
29-
<li key={c.id}>
30-
<Link href={`/categories/${c.handle}`}>{c.title}</Link>
31-
</li>
32-
))}
28+
{product_categories?.slice(0, 6).map((c) => {
29+
return (
30+
<li key={c.id}>
31+
<Link href={`/categories/${c.handle}`}>{c.name}</Link>
32+
</li>
33+
)
34+
})}
3335
</ul>
3436
</div>
3537
<div className="flex flex-col gap-y-2">
3638
<span className="text-base-semi">Collections</span>
3739
<ul
38-
className={clsx("grid grid-cols-1 gap-y-2", {
39-
"grid-cols-2": (collections?.length || 0) > 4,
40+
className={clsx("grid grid-cols-1 gap-2", {
41+
"grid-cols-2": (collections?.length || 0) > 3,
4042
})}
4143
>
42-
{collections?.map((c) => (
44+
{collections?.slice(0, 6).map((c) => (
4345
<li key={c.id}>
4446
<Link href={`/collections/${c.handle}`}>{c.title}</Link>
4547
</li>

0 commit comments

Comments
 (0)