diff --git a/components/cart/CartItem/CartItem.tsx b/components/cart/CartItem/CartItem.tsx index ac78d1849..2337c871c 100644 --- a/components/cart/CartItem/CartItem.tsx +++ b/components/cart/CartItem/CartItem.tsx @@ -12,7 +12,7 @@ const CartItem = ({ item, currencyCode, }: { - item: any + item: CartItem currencyCode: string }) => { const { price } = usePrice({ @@ -55,7 +55,7 @@ const CartItem = ({ try { // If this action succeeds then there's no need to do `setRemoving(true)` // because the component will be removed from the view - await removeItem({ id: item.id }) + await removeItem({ id: String(item.id) }) } catch (error) { setRemoving(false) } @@ -77,16 +77,14 @@ const CartItem = ({
Product Image
- {/** TODO: Replace this. No `path` found at Cart */} {item.name} @@ -115,7 +113,10 @@ const CartItem = ({
{price} -
diff --git a/components/cart/CartSidebarView/CartSidebarView.tsx b/components/cart/CartSidebarView/CartSidebarView.tsx index 466ef15b6..19c6964d7 100644 --- a/components/cart/CartSidebarView/CartSidebarView.tsx +++ b/components/cart/CartSidebarView/CartSidebarView.tsx @@ -16,19 +16,17 @@ const CartSidebarView: FC = () => { const { price: subTotal } = usePrice( data && { amount: data.base_amount, - currencyCode: data.currency.code, + currencyCode: data.currency?.code || 'USD', } ) const { price: total } = usePrice( data && { amount: data.cart_amount, - currencyCode: data.currency.code, + currencyCode: data.currency?.code || 'USD', } ) const handleClose = () => closeSidebar() - const items = data?.line_items.physical_items ?? [] - const error = null const success = null @@ -95,7 +93,7 @@ const CartSidebarView: FC = () => { My Cart