1
0
mirror of https://github.com/vercel/commerce.git synced 2025-06-07 00:36:59 +00:00

Adds more home page carousel products for wide screens ()

This commit is contained in:
Michael Novotny 2023-08-03 21:17:02 -05:00 committed by GitHub
parent 0e13cfc3dd
commit ef92d578cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,10 +8,13 @@ export async function Carousel() {
if (!products?.length) return null;
// Purposefully duplicating products to make the carousel loop and not run out of products on wide screens.
const carouselProducts = [...products, ...products, ...products];
return (
<div className=" w-full overflow-x-auto pb-6 pt-1">
<ul className="flex animate-carousel gap-4">
{[...products, ...products].map((product, i) => (
{carouselProducts.map((product, i) => (
<li
key={`${product.handle}${i}`}
className="relative aspect-square h-[30vh] max-h-[275px] w-2/3 max-w-[475px] flex-none md:w-1/3"