From d94396baacc2dcbc77b6993b826fe5d32c3115cb Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Mon, 12 Oct 2020 17:59:13 -0500 Subject: [PATCH] Check for nullables in product info --- components/product/ProductView/ProductView.tsx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/components/product/ProductView/ProductView.tsx b/components/product/ProductView/ProductView.tsx index 0609afa46..3aa8c77dc 100644 --- a/components/product/ProductView/ProductView.tsx +++ b/components/product/ProductView/ProductView.tsx @@ -8,17 +8,10 @@ import type { Product } from '@lib/bigcommerce/api/operations/get-product' import useAddItem from '@lib/bigcommerce/cart/use-add-item' import { useUI } from '@components/ui/context' -interface ProductData { - name: string - images?: any - prices?: any - path: string -} - interface Props { className?: string children?: any - product: Product & ProductData + product: Product } interface Choices { @@ -56,16 +49,16 @@ const ProductView: FC = ({ product, className }) => { {product.name}
- {product.prices.price.value} + {product.prices?.price.value} {` `} - {product.prices.price.currencyCode} + {product.prices?.price.currencyCode}