add product route, separate layouts between home & pages

This commit is contained in:
andr-ew
2023-06-21 18:53:04 -05:00
parent c174b6ad79
commit f0187e9f7a
7 changed files with 45 additions and 9 deletions

View File

@@ -0,0 +1,17 @@
import { getProducts } from 'lib/shopify';
export async function generateStaticParams() {
const products = await getProducts({
sortKey: 'UPDATED_AT',
reverse: false,
query: '',
});
console.log({ products });
return products.map(product => ({ product: product.handle }));
}
export default async function ProductPage({ params: { handle } }) {
return <h1>{handle}</h1>;
}