mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
add product route, separate layouts between home & pages
This commit is contained in:
13
app/(home)/search/[collection]/page.js
Normal file
13
app/(home)/search/[collection]/page.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { getCollections } from 'lib/shopify';
|
||||
|
||||
import { HomeProductsList } from '/components/home.js';
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const collections = await getCollections();
|
||||
|
||||
return collections.map(collection => ({ collection: collection.handle }));
|
||||
}
|
||||
|
||||
export default async function CollectionPage({ params: { collection } }) {
|
||||
return <HomeProductsList collection={collection} />;
|
||||
}
|
Reference in New Issue
Block a user