Fix missing images (#264)

Co-authored-by: B <curciobelen@gmail.com>
This commit is contained in:
cond0r
2021-06-01 05:34:28 +03:00
committed by GitHub
parent 277471cd16
commit 0792eabd4c
2 changed files with 6 additions and 4 deletions

View File

@@ -16,6 +16,8 @@ interface Props {
product: Product
}
const placeholderImg = '/product-img-placeholder.svg'
const WishlistCard: FC<Props> = ({ product }) => {
const { price } = usePrice({
amount: product.prices?.price?.value,
@@ -58,10 +60,10 @@ const WishlistCard: FC<Props> = ({ product }) => {
<div className={cn(s.root, { 'opacity-75 pointer-events-none': removing })}>
<div className={`col-span-3 ${s.productBg}`}>
<Image
src={product.images[0].url}
src={product.images[0]?.url || placeholderImg}
width={400}
height={400}
alt={product.images[0].alt || 'Product Image'}
alt={product.images[0]?.alt || 'Product Image'}
/>
</div>