ProductGrid

This commit is contained in:
Belen Curcio
2020-10-01 17:25:48 -03:00
parent ba4b3b765c
commit de949095d7
21 changed files with 134 additions and 66 deletions

View File

@@ -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>
);
}