mirror of
https://github.com/vercel/commerce.git
synced 2025-06-19 21:51:21 +00:00
Merge branch 'master' of https://github.com/vercel/commerce into nodejs-provider
This commit is contained in:
commit
4611748fee
@ -34,7 +34,7 @@ const ProductCard: FC<Props> = ({
|
|||||||
{product?.images && (
|
{product?.images && (
|
||||||
<Image
|
<Image
|
||||||
quality="85"
|
quality="85"
|
||||||
src={product.images[0].url || placeholderImg}
|
src={product.images[0]?.url || placeholderImg}
|
||||||
alt={product.name || 'Product Image'}
|
alt={product.name || 'Product Image'}
|
||||||
height={320}
|
height={320}
|
||||||
width={320}
|
width={320}
|
||||||
@ -70,7 +70,7 @@ const ProductCard: FC<Props> = ({
|
|||||||
<Image
|
<Image
|
||||||
alt={product.name || 'Product Image'}
|
alt={product.name || 'Product Image'}
|
||||||
className={s.productImage}
|
className={s.productImage}
|
||||||
src={product.images[0].url || placeholderImg}
|
src={product.images[0]?.url || placeholderImg}
|
||||||
height={540}
|
height={540}
|
||||||
width={540}
|
width={540}
|
||||||
quality="85"
|
quality="85"
|
||||||
|
@ -16,6 +16,8 @@ interface Props {
|
|||||||
product: Product
|
product: Product
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const placeholderImg = '/product-img-placeholder.svg'
|
||||||
|
|
||||||
const WishlistCard: FC<Props> = ({ product }) => {
|
const WishlistCard: FC<Props> = ({ product }) => {
|
||||||
const { price } = usePrice({
|
const { price } = usePrice({
|
||||||
amount: product.price?.value,
|
amount: product.price?.value,
|
||||||
@ -61,10 +63,10 @@ const WishlistCard: FC<Props> = ({ product }) => {
|
|||||||
<div className={cn(s.root, { 'opacity-75 pointer-events-none': removing })}>
|
<div className={cn(s.root, { 'opacity-75 pointer-events-none': removing })}>
|
||||||
<div className={`col-span-3 ${s.productBg}`}>
|
<div className={`col-span-3 ${s.productBg}`}>
|
||||||
<Image
|
<Image
|
||||||
src={product.images[0].url}
|
src={product.images[0]?.url || placeholderImg}
|
||||||
width={400}
|
width={400}
|
||||||
height={400}
|
height={400}
|
||||||
alt={product.images[0].alt || 'Product Image'}
|
alt={product.images[0]?.alt || 'Product Image'}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ module.exports = withCommerceConfig({
|
|||||||
source: '/search/:category',
|
source: '/search/:category',
|
||||||
destination: '/search',
|
destination: '/search',
|
||||||
},
|
},
|
||||||
].filter((x) => x)
|
].filter(Boolean)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -49,15 +49,7 @@ export default function Home({
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Marquee variant="secondary">
|
<Marquee variant="secondary">
|
||||||
{products.slice(0, 3).map((product, i) => (
|
{products.slice(0, 3).map((product, i) => (
|
||||||
<ProductCard
|
<ProductCard key={product.id} product={product} variant="slim" />
|
||||||
key={product.id}
|
|
||||||
product={product}
|
|
||||||
variant="slim"
|
|
||||||
imgProps={{
|
|
||||||
width: 320,
|
|
||||||
height: 320,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
))}
|
))}
|
||||||
</Marquee>
|
</Marquee>
|
||||||
<Hero
|
<Hero
|
||||||
@ -84,15 +76,7 @@ export default function Home({
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Marquee>
|
<Marquee>
|
||||||
{products.slice(0, 3).map((product, i) => (
|
{products.slice(0, 3).map((product, i) => (
|
||||||
<ProductCard
|
<ProductCard key={product.id} product={product} variant="slim" />
|
||||||
key={product.id}
|
|
||||||
product={product}
|
|
||||||
variant="slim"
|
|
||||||
imgProps={{
|
|
||||||
width: 320,
|
|
||||||
height: 320,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
))}
|
))}
|
||||||
</Marquee>
|
</Marquee>
|
||||||
{/* <HomeAllProductsGrid
|
{/* <HomeAllProductsGrid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user