Skip to content

Commit

Permalink
Variable
Browse files Browse the repository at this point in the history
  • Loading branch information
manovotny committed Aug 3, 2023
1 parent 643cf86 commit d98b1d7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +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">
// Purposefully duplicating products to make the carousel loop and not run // out of
products on wide screens.
{[...products, ...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"
Expand Down

0 comments on commit d98b1d7

Please sign in to comment.