forked from crowetic/commerce
Normalizing more operations
This commit is contained in:
parent
def1cf0778
commit
1742ae8ea6
@ -25,7 +25,7 @@ const ProductCard: FC<Props> = ({ className, product, variant, imgProps }) => {
|
||||
{product.name}
|
||||
</span>
|
||||
</div>
|
||||
{product.images[0] && (
|
||||
{product.images?[0] && (
|
||||
<Image
|
||||
quality="85"
|
||||
alt={product.name}
|
||||
@ -54,11 +54,11 @@ const ProductCard: FC<Props> = ({ className, product, variant, imgProps }) => {
|
||||
<WishlistButton
|
||||
className={s.wishlistButton}
|
||||
productId={product.id}
|
||||
variant={product.variants[0]!}
|
||||
variant={product.variants?[0]}
|
||||
/>
|
||||
</div>
|
||||
<div className={s.imageContainer}>
|
||||
{product.images[0] && (
|
||||
{product.images?[0] && (
|
||||
<Image
|
||||
alt={product.name}
|
||||
className={s.productImage}
|
||||
|
2
framework/types.d.ts
vendored
2
framework/types.d.ts
vendored
@ -9,7 +9,7 @@ interface Product extends Entity {
|
||||
slug: string
|
||||
path?: string
|
||||
images: ProductImage[] | any[] | undefined
|
||||
variants: ProductVariant[] | any[] | undefined
|
||||
variants: ProductVariant[] | any[] | null | undefined
|
||||
price: ProductPrice
|
||||
}
|
||||
interface ProductImage {
|
||||
|
Loading…
x
Reference in New Issue
Block a user