From 8f1c545b0f860e2a3df27382ee71afc463543612 Mon Sep 17 00:00:00 2001 From: Niels Lange Date: Thu, 8 Sep 2022 20:54:30 +0700 Subject: [PATCH] Rename crossSellsProduct to product --- .../cart-cross-sells-product.tsx | 8 ++++---- .../cart/cart-cross-sells-product-list/index.tsx | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/assets/js/blocks/cart/cart-cross-sells-product-list/cart-cross-sells-product.tsx b/assets/js/blocks/cart/cart-cross-sells-product-list/cart-cross-sells-product.tsx index b766639a679..067844d2116 100644 --- a/assets/js/blocks/cart/cart-cross-sells-product-list/cart-cross-sells-product.tsx +++ b/assets/js/blocks/cart/cart-cross-sells-product-list/cart-cross-sells-product.tsx @@ -19,12 +19,12 @@ import { Block as ProductButton } from '../../../atomic/blocks/product-elements/ import AddToCartButton from '../../../atomic/blocks/product-elements/add-to-cart/block'; interface CrossSellsProductProps { - crossSellsProduct: ProductResponseItem; + product: ProductResponseItem; isLoading: boolean; } const CartCrossSellsProduct = ( { - crossSellsProduct, + product, }: CrossSellsProductProps ): JSX.Element => { return (
@@ -35,7 +35,7 @@ const CartCrossSellsProduct = ( {
- { crossSellsProduct.is_in_stock ? ( + { product.is_in_stock ? ( ) : ( diff --git a/assets/js/blocks/cart/cart-cross-sells-product-list/index.tsx b/assets/js/blocks/cart/cart-cross-sells-product-list/index.tsx index 96afb71a62d..142d91030ce 100644 --- a/assets/js/blocks/cart/cart-cross-sells-product-list/index.tsx +++ b/assets/js/blocks/cart/cart-cross-sells-product-list/index.tsx @@ -9,27 +9,29 @@ import { ProductResponseItem } from '@woocommerce/type-defs/product-response'; import CartCrossSellsProduct from './cart-cross-sells-product'; interface CrossSellsProductListProps { - crossSellsProducts: ProductResponseItem[]; + products: ProductResponseItem[]; className?: string | undefined; columns: number; } const CartCrossSellsProductList = ( { - crossSellsProducts, + products, columns, }: CrossSellsProductListProps ): JSX.Element => { - const products = crossSellsProducts.map( ( crossSellsProduct, i ) => { + const crossSellsProducts = products.map( ( product, i ) => { if ( i >= columns ) return null; return ( ); } ); - return
{ products }
; + return
{ crossSellsProducts }
; }; export default CartCrossSellsProductList;