2020-10-01 20:40:40 -05:00
|
|
|
|
import { GetStaticPropsContext, InferGetStaticPropsType } from 'next'
|
2020-10-02 14:51:36 -03:00
|
|
|
|
import getAllProducts from '@lib/bigcommerce/api/operations/get-all-products'
|
2020-10-01 20:40:40 -05:00
|
|
|
|
import { Layout } from '@components/core'
|
2020-10-04 16:34:22 -03:00
|
|
|
|
import { Grid, Marquee, Hero } from '@components/ui'
|
|
|
|
|
import { ProductCard } from '@components/product'
|
2020-09-30 13:36:02 -05:00
|
|
|
|
|
|
|
|
|
export async function getStaticProps({ preview }: GetStaticPropsContext) {
|
2020-10-01 20:40:40 -05:00
|
|
|
|
const { products } = await getAllProducts()
|
2020-10-05 11:44:14 -03:00
|
|
|
|
|
2020-09-30 13:36:02 -05:00
|
|
|
|
return {
|
2020-10-04 15:16:56 -03:00
|
|
|
|
props: { products },
|
2020-10-01 20:40:40 -05:00
|
|
|
|
}
|
2020-09-30 13:36:02 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function Home({
|
|
|
|
|
products,
|
|
|
|
|
}: InferGetStaticPropsType<typeof getStaticProps>) {
|
2020-10-03 11:33:31 -03:00
|
|
|
|
return (
|
|
|
|
|
<>
|
2020-10-04 16:34:22 -03:00
|
|
|
|
<Grid items={products.slice(0, 3)} wrapper={ProductCard} />
|
2020-10-05 11:44:14 -03:00
|
|
|
|
<Marquee
|
|
|
|
|
items={[...products.slice(3, 6)]}
|
|
|
|
|
wrapper={(p: any) => (
|
|
|
|
|
<div className="relative overflow-hidden p-6 box-border">
|
|
|
|
|
<img
|
|
|
|
|
className="object-scale-down h-24"
|
|
|
|
|
src={p.node.images.edges[0].node.urlSmall}
|
|
|
|
|
/>
|
|
|
|
|
<div className="absolute inset-0 flex items-center justify-end mr-8">
|
|
|
|
|
<span className="bg-black text-white inline-block p-3 font-bold text-xl break-words">
|
|
|
|
|
{p.node.name}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
/>
|
2020-10-04 17:47:05 -03:00
|
|
|
|
<Hero
|
|
|
|
|
headline="Release Details: The Yeezy BOOST 350 V2 ‘Natural'"
|
|
|
|
|
description="
|
|
|
|
|
The Yeezy BOOST 350 V2 lineup continues to grow. We recently had the
|
|
|
|
|
‘Carbon’ iteration, and now release details have been locked in for
|
|
|
|
|
this ‘Natural’ joint. Revealed by Yeezy Mafia earlier this year, the
|
|
|
|
|
shoe was originally called ‘Abez’, which translated to ‘Tin’ in
|
|
|
|
|
Hebrew. It’s now undergone a name change, and will be referred to as
|
|
|
|
|
‘Natural’."
|
|
|
|
|
/>
|
2020-10-05 11:44:14 -03:00
|
|
|
|
<Grid items={products.slice(3, 6)} layout="B" wrapper={ProductCard} />
|
2020-10-04 15:16:56 -03:00
|
|
|
|
<Marquee
|
2020-10-05 11:44:14 -03:00
|
|
|
|
items={[...products.slice(3, 6)]}
|
|
|
|
|
variant="secondary"
|
2020-10-04 15:16:56 -03:00
|
|
|
|
wrapper={(p: any) => (
|
2020-10-04 17:47:05 -03:00
|
|
|
|
<div className="relative overflow-hidden p-6 box-border">
|
|
|
|
|
<img
|
|
|
|
|
className="object-scale-down h-24"
|
|
|
|
|
src={p.node.images.edges[0].node.urlSmall}
|
|
|
|
|
/>
|
|
|
|
|
<div className="absolute inset-0 flex items-center justify-end mr-8">
|
|
|
|
|
<span className="bg-black text-white inline-block p-3 font-bold text-xl break-words">
|
|
|
|
|
{p.node.name}
|
|
|
|
|
</span>
|
2020-10-04 16:34:22 -03:00
|
|
|
|
</div>
|
2020-10-04 15:16:56 -03:00
|
|
|
|
</div>
|
|
|
|
|
)}
|
2020-10-03 11:33:31 -03:00
|
|
|
|
/>
|
2020-10-05 11:44:14 -03:00
|
|
|
|
<div className="py-12 flex flex-row w-full">
|
|
|
|
|
<div className="flex-0 pr-3 w-48">
|
2020-10-04 16:34:22 -03:00
|
|
|
|
ALL CATEGORIES ACCESSORIES BAGS CLOTHING SHOES ALL DESIGNERS 032c 1017
|
2020-10-05 11:44:14 -03:00
|
|
|
|
</div>
|
|
|
|
|
<div className="flex-1">
|
|
|
|
|
<Grid
|
|
|
|
|
items={[
|
|
|
|
|
...products.slice(6),
|
|
|
|
|
...products.slice(6),
|
|
|
|
|
...products.slice(6),
|
|
|
|
|
]}
|
|
|
|
|
layout="normal"
|
|
|
|
|
wrapper={ProductCard}
|
|
|
|
|
/>
|
2020-10-04 16:34:22 -03:00
|
|
|
|
</div>
|
2020-10-04 15:16:56 -03:00
|
|
|
|
</div>
|
2020-10-03 11:33:31 -03:00
|
|
|
|
</>
|
|
|
|
|
)
|
2020-09-30 11:44:38 -05:00
|
|
|
|
}
|
2020-10-01 21:30:08 -05:00
|
|
|
|
|
|
|
|
|
Home.Layout = Layout
|