mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 22:16:58 +00:00
use tile in carousel
This commit is contained in:
parent
01f02952fd
commit
3832377c88
@ -1,7 +1,6 @@
|
|||||||
import { getCollectionProducts } from 'lib/shopify';
|
import { getCollectionProducts } from 'lib/shopify';
|
||||||
import Image from 'next/image';
|
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import Label from './label';
|
import { GridTileImage } from './grid/tile';
|
||||||
|
|
||||||
export async function Carousel() {
|
export async function Carousel() {
|
||||||
// Collections that start with `hidden-*` are hidden from the search page.
|
// Collections that start with `hidden-*` are hidden from the search page.
|
||||||
@ -18,19 +17,17 @@ export async function Carousel() {
|
|||||||
href={`/product/${product.handle}`}
|
href={`/product/${product.handle}`}
|
||||||
className="relative h-[30vh] w-2/3 flex-none rounded-lg border border-gray-200 bg-white dark:border-gray-800 dark:bg-black md:w-1/3"
|
className="relative h-[30vh] w-2/3 flex-none rounded-lg border border-gray-200 bg-white dark:border-gray-800 dark:bg-black md:w-1/3"
|
||||||
>
|
>
|
||||||
{product.featuredImage ? (
|
<GridTileImage
|
||||||
<Image
|
alt={product.title}
|
||||||
alt={product.title}
|
labels={{
|
||||||
className="h-full object-contain"
|
isSmall: true,
|
||||||
fill
|
title: product.title,
|
||||||
sizes="33vw"
|
amount: product.priceRange.maxVariantPrice.amount,
|
||||||
src={product.featuredImage.url}
|
currencyCode: product.priceRange.maxVariantPrice.currencyCode
|
||||||
/>
|
}}
|
||||||
) : null}
|
src={product.featuredImage?.url}
|
||||||
<Label
|
width={600}
|
||||||
title={product.title}
|
height={600}
|
||||||
amount={product.priceRange.maxVariantPrice.amount}
|
|
||||||
currencyCode={product.priceRange.maxVariantPrice.currencyCode}
|
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
))}
|
))}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user