mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
ProductGrid
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { GetStaticPropsContext, InferGetStaticPropsType } from 'next';
|
||||
import getAllProducts from 'lib/bigcommerce/api/operations/get-all-products';
|
||||
import { Layout } from '@components/core';
|
||||
import { GetStaticPropsContext, InferGetStaticPropsType } from "next";
|
||||
import getAllProducts from "lib/bigcommerce/api/operations/get-all-products";
|
||||
import { Layout } from "@components/core";
|
||||
import { ProductGrid } from "@components/product";
|
||||
|
||||
export async function getStaticProps({ preview }: GetStaticPropsContext) {
|
||||
const { products } = await getAllProducts();
|
||||
|
||||
return {
|
||||
props: { products },
|
||||
};
|
||||
@@ -13,15 +13,10 @@ export async function getStaticProps({ preview }: GetStaticPropsContext) {
|
||||
export default function Home({
|
||||
products,
|
||||
}: InferGetStaticPropsType<typeof getStaticProps>) {
|
||||
console.log('PRODUCTS', products);
|
||||
|
||||
console.log("PRODUCTS", products);
|
||||
return (
|
||||
<Layout>
|
||||
<div className="h-full grid grid-cols-1 h-full lg:grid-cols-3 lg:grid-rows-2">
|
||||
<div className="lg:row-span-2 lg:col-span-2 bg-violet h-full"></div>
|
||||
<div className="lg:row-span-1 lg:col-span-1 bg-black h-full"></div>
|
||||
<div className="lg:row-span-1 lg:col-span-1 bg-pink"></div>
|
||||
</div>
|
||||
<ProductGrid products={products} />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user