mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Added brands
This commit is contained in:
@@ -7,16 +7,17 @@ import getSiteInfo from '@lib/bigcommerce/api/operations/get-site-info'
|
||||
|
||||
export async function getStaticProps({ preview }: GetStaticPropsContext) {
|
||||
const { products } = await getAllProducts()
|
||||
const { categories } = await getSiteInfo()
|
||||
const { categories, brands } = await getSiteInfo()
|
||||
|
||||
return {
|
||||
props: { products, categories },
|
||||
props: { products, categories, brands },
|
||||
}
|
||||
}
|
||||
|
||||
export default function Home({
|
||||
products,
|
||||
categories,
|
||||
brands,
|
||||
}: InferGetStaticPropsType<typeof getStaticProps>) {
|
||||
return (
|
||||
<>
|
||||
@@ -53,6 +54,16 @@ export default function Home({
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<ul className="uppercase mt-6">
|
||||
<li>
|
||||
<h2 className="font-bold">All Designers</h2>
|
||||
</li>
|
||||
{brands.flatMap(({ node }) => (
|
||||
<li key={node.path} className="mt-2">
|
||||
<a href="#">{node.name}</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<Grid
|
||||
|
@@ -42,7 +42,7 @@ export async function getStaticPaths() {
|
||||
const { products } = await getAllProductPaths()
|
||||
|
||||
return {
|
||||
paths: products.map((product) => `/product${product!.node.path}`),
|
||||
paths: products.map((product) => `/product${product.node.path}`),
|
||||
fallback: false,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user