Skip to content

Commit

Permalink
Adds more home page carousel products for wide screens (#1142)
Browse files Browse the repository at this point in the history
  • Loading branch information
manovotny authored Aug 4, 2023
1 parent 0e13cfc commit ef92d57
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

1 comment on commit ef92d57

@vercel
Copy link

@vercel vercel bot commented on ef92d57 Aug 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.