Merge a87ad94d2fbb90e5b6cde7ad62fb8ce6de0b0ba1 into fa1306916c652ea5f820d5b400087bece13460fd

This commit is contained in:
Mattia Zanella 2025-05-20 22:43:02 +02:00 committed by GitHub
commit 4ecca466f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,6 +3,8 @@ import { getCollectionProducts } from 'lib/shopify';
import type { Product } from 'lib/shopify/types';
import Link from 'next/link';
const MINIMUM_PRODUCTS_QUANTITY = 3;
function ThreeItemGridItem({
item,
size,
@ -47,7 +49,7 @@ export async function ThreeItemGrid() {
collection: 'hidden-homepage-featured-items'
});
if (!homepageItems[0] || !homepageItems[1] || !homepageItems[2]) return null;
if (homepageItems.length < MINIMUM_PRODUCTS_QUANTITY) return null;
const [firstProduct, secondProduct, thirdProduct] = homepageItems;