mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
fix: update layout for PLP
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
import Grid from 'components/grid';
|
||||
import { GridTileImage } from 'components/grid/tile';
|
||||
import { Product } from 'lib/shopify/types';
|
||||
import Link from 'next/link';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { getProductsInCollection, searchProducts } from './actions';
|
||||
|
||||
@@ -66,22 +65,21 @@ const ProductsList = ({
|
||||
{products.map((product, index) => (
|
||||
<Grid.Item
|
||||
key={product.handle}
|
||||
className="animate-fadeIn rounded-lg"
|
||||
className="animate-fadeIn"
|
||||
ref={index === products.length - 1 && _pageInfo.hasNextPage ? lastElement : undefined}
|
||||
>
|
||||
<Link className="relative inline-block h-full w-full" href={`/product/${product.handle}`}>
|
||||
<GridTileImage
|
||||
alt={product.title}
|
||||
label={{
|
||||
title: product.title,
|
||||
amount: product.priceRange.maxVariantPrice.amount,
|
||||
currencyCode: product.priceRange.maxVariantPrice.currencyCode
|
||||
}}
|
||||
src={product.featuredImage?.url}
|
||||
fill
|
||||
sizes="(min-width: 768px) 33vw, (min-width: 640px) 50vw, 100vw"
|
||||
/>
|
||||
</Link>
|
||||
<GridTileImage
|
||||
alt={product.title}
|
||||
label={{
|
||||
title: product.title,
|
||||
amount: product.priceRange.maxVariantPrice.amount,
|
||||
currencyCode: product.priceRange.maxVariantPrice.currencyCode
|
||||
}}
|
||||
src={product.featuredImage?.url}
|
||||
fill
|
||||
sizes="(min-width: 768px) 33vw, (min-width: 640px) 50vw, 100vw"
|
||||
href={`/product/${product.handle}`}
|
||||
/>
|
||||
</Grid.Item>
|
||||
))}
|
||||
</>
|
||||
|
Reference in New Issue
Block a user