sorting out the three item grid, to not be three items anymore 😏

This commit is contained in:
Samantha Kellow 2023-08-20 20:37:09 +01:00
parent 4a7aa19084
commit 85938dcd54

View File

@ -33,15 +33,13 @@ export async function ThreeItemGrid() {
collection: 'hidden-homepage-featured-items' collection: 'hidden-homepage-featured-items'
}); });
// if (!homepageItems[0] || !homepageItems[1] || !homepageItems[2]) return null;
const [firstProduct, secondProduct, thirdProduct] = homepageItems;
return ( return (
<section className="mx-auto grid max-w-screen-2xl gap-4 px-4 pb-4 lg:grid-cols-6 lg:grid-rows-6"> <>
{firstProduct && <ThreeItemGridItem size="half" item={firstProduct} />} <section className="mx-auto grid max-w-screen-2xl gap-4 px-4 pb-4 lg:grid-cols-6 lg:grid-rows-6 mt-6">
{secondProduct && <ThreeItemGridItem size="half" item={secondProduct} />} {homepageItems.map(item => (
{thirdProduct && <ThreeItemGridItem size="half" item={thirdProduct} />} <ThreeItemGridItem size="half" item={item} />
))}
</section> </section>
</>
); );
} }