From cd7005a13ace65741f4368df76bc257d904846d4 Mon Sep 17 00:00:00 2001 From: Samantha Kellow Date: Fri, 15 Sep 2023 17:43:26 +0100 Subject: [PATCH] filtering products to display only live products --- app/page.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index 322a755f7..c6ed27e85 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,6 +1,8 @@ import { Carousel } from 'components/carousel'; -import { ThreeItemGrid } from 'components/grid/three-items'; +import Grid from 'components/grid'; import Footer from 'components/layout/footer'; +import ProductGridItems from 'components/layout/product-grid-items'; +import { getProducts } from 'lib/shopify'; import { Suspense } from 'react'; export const runtime = 'edge'; @@ -13,11 +15,18 @@ export const metadata = { }; export default async function HomePage() { + const products = await getProducts({}); + const liveProducts = products.filter((product) => !product.tags.includes('hidden-product')) + return ( <> - + {liveProducts.length > 0 ? ( + + + + ) : null}