4
0
forked from crowetic/commerce
commerce/pages/index.tsx

28 lines
858 B
TypeScript
Raw Normal View History

2020-09-30 13:36:02 -05:00
import { GetStaticPropsContext, InferGetStaticPropsType } from 'next';
2020-09-30 21:08:25 -05:00
import getAllProducts from 'lib/bigcommerce/api/operations/get-all-products';
2020-09-30 13:36:02 -05:00
import { Layout } from '@components/core';
export async function getStaticProps({ preview }: GetStaticPropsContext) {
2020-09-30 21:08:25 -05:00
const { products } = await getAllProducts();
2020-09-30 13:36:02 -05:00
return {
props: { products },
};
}
export default function Home({
products,
}: InferGetStaticPropsType<typeof getStaticProps>) {
console.log('PRODUCTS', products);
2020-09-30 11:44:38 -05:00
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>
</Layout>
);
}