mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Add links to the categories & brands in the landing
This commit is contained in:
@@ -5,9 +5,11 @@ import getAllProducts from '@lib/bigcommerce/api/operations/get-all-products'
|
||||
import getSiteInfo from '@lib/bigcommerce/api/operations/get-site-info'
|
||||
import getAllPages from '@lib/bigcommerce/api/operations/get-all-pages'
|
||||
import rangeMap from '@lib/range-map'
|
||||
import { getCategoryPath, getDesignerPath } from '@utils/search'
|
||||
import { Layout } from '@components/core'
|
||||
import { Grid, Marquee, Hero } from '@components/ui'
|
||||
import { ProductCard } from '@components/product'
|
||||
import Link from 'next/link'
|
||||
|
||||
export async function getStaticProps({
|
||||
preview,
|
||||
@@ -132,21 +134,29 @@ export default function Home({
|
||||
<div className="sticky top-32">
|
||||
<ul className="mb-10">
|
||||
<li className="py-1 text-base font-bold tracking-wide">
|
||||
All Categories
|
||||
<Link href={getCategoryPath('')}>
|
||||
<a>All Categories</a>
|
||||
</Link>
|
||||
</li>
|
||||
{categories.map((cat) => (
|
||||
<li key={cat.path} className="py-1 text-accents-8">
|
||||
<a href="#">{cat.name}</a>
|
||||
<Link href={getCategoryPath(cat.path)}>
|
||||
<a>{cat.name}</a>
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<ul className="">
|
||||
<li className="py-1 text-base font-bold tracking-wide">
|
||||
All Designers
|
||||
<Link href={getDesignerPath('')}>
|
||||
<a>All Designers</a>
|
||||
</Link>
|
||||
</li>
|
||||
{brands.flatMap(({ node }) => (
|
||||
<li key={node.path} className="py-1 text-accents-8">
|
||||
<a href="#">{node.name}</a>
|
||||
<Link href={getDesignerPath(node.path)}>
|
||||
<a>{node.name}</a>
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
@@ -76,7 +76,7 @@ export default function Search({
|
||||
>
|
||||
<Link
|
||||
href={{
|
||||
pathname: getCategoryPath(getSlug(cat.path), brand),
|
||||
pathname: getCategoryPath(cat.path, brand),
|
||||
query,
|
||||
}}
|
||||
>
|
||||
@@ -100,7 +100,7 @@ export default function Search({
|
||||
>
|
||||
<Link
|
||||
href={{
|
||||
pathname: getDesignerPath(getSlug(node.path), category),
|
||||
pathname: getDesignerPath(node.path, category),
|
||||
query,
|
||||
}}
|
||||
>
|
||||
|
Reference in New Issue
Block a user