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}
|
{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}
|
||||||
|
2
framework/types.d.ts
vendored
2
framework/types.d.ts
vendored
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user