4
0
forked from crowetic/commerce

Normalizing more operations

This commit is contained in:
Belen Curcio 2021-01-10 16:25:25 -03:00
parent def1cf0778
commit 1742ae8ea6
2 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,7 @@ const ProductCard: FC<Props> = ({ className, product, variant, imgProps }) => {
{product.name} {product.name}
</span> </span>
</div> </div>
{product.images[0] && ( {product.images?[0] && (
<Image <Image
quality="85" quality="85"
alt={product.name} alt={product.name}
@ -54,11 +54,11 @@ const ProductCard: FC<Props> = ({ className, product, variant, imgProps }) => {
<WishlistButton <WishlistButton
className={s.wishlistButton} className={s.wishlistButton}
productId={product.id} productId={product.id}
variant={product.variants[0]!} variant={product.variants?[0]}
/> />
</div> </div>
<div className={s.imageContainer}> <div className={s.imageContainer}>
{product.images[0] && ( {product.images?[0] && (
<Image <Image
alt={product.name} alt={product.name}
className={s.productImage} className={s.productImage}

View File

@ -9,7 +9,7 @@ interface Product extends Entity {
slug: string slug: string
path?: string path?: string
images: ProductImage[] | any[] | undefined images: ProductImage[] | any[] | undefined
variants: ProductVariant[] | any[] | undefined variants: ProductVariant[] | any[] | null | undefined
price: ProductPrice price: ProductPrice
} }
interface ProductImage { interface ProductImage {