From c0ee3f0a91956c2d6ab66db0ffe4b5abad7e1fd8 Mon Sep 17 00:00:00 2001 From: Niels Lange Date: Tue, 20 Jun 2023 10:23:27 +0200 Subject: [PATCH 1/2] Reference Mini Cart drawer preview dynamically --- assets/js/blocks/mini-cart/edit.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/js/blocks/mini-cart/edit.tsx b/assets/js/blocks/mini-cart/edit.tsx index 5441474f712..c0359152489 100644 --- a/assets/js/blocks/mini-cart/edit.tsx +++ b/assets/js/blocks/mini-cart/edit.tsx @@ -26,6 +26,7 @@ import { select } from '@wordpress/data'; import classNames from 'classnames'; import { cartOutline, bag, bagAlt } from '@woocommerce/icons'; import { Icon } from '@wordpress/icons'; +import { WC_BLOCKS_IMAGE_URL } from '@woocommerce/block-settings'; /** * Internal dependencies @@ -237,8 +238,8 @@ const Edit = ( { className="wc-block-editor-mini-cart__drawer-image" src={ isRTL() - ? '/wp-content/plugins/woocommerce-blocks/images/blocks/mini-cart/cart-drawer-rtl.svg' - : '/wp-content/plugins/woocommerce-blocks/images/blocks/mini-cart/cart-drawer.svg' + ? `${ WC_BLOCKS_IMAGE_URL }/blocks/mini-cart/cart-drawer-rtl.svg` + : `${ WC_BLOCKS_IMAGE_URL }/blocks/mini-cart/cart-drawer.svg` } alt="" /> From faf2aebfcf874e90f7a9a5123154fce7a670251a Mon Sep 17 00:00:00 2001 From: Niels Lange Date: Tue, 20 Jun 2023 11:21:40 +0200 Subject: [PATCH 2/2] Update assets/js/blocks/mini-cart/edit.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Albert Juhé Lluveras --- assets/js/blocks/mini-cart/edit.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/blocks/mini-cart/edit.tsx b/assets/js/blocks/mini-cart/edit.tsx index c0359152489..d5b3a687d48 100644 --- a/assets/js/blocks/mini-cart/edit.tsx +++ b/assets/js/blocks/mini-cart/edit.tsx @@ -238,8 +238,8 @@ const Edit = ( { className="wc-block-editor-mini-cart__drawer-image" src={ isRTL() - ? `${ WC_BLOCKS_IMAGE_URL }/blocks/mini-cart/cart-drawer-rtl.svg` - : `${ WC_BLOCKS_IMAGE_URL }/blocks/mini-cart/cart-drawer.svg` + ? `${ WC_BLOCKS_IMAGE_URL }blocks/mini-cart/cart-drawer-rtl.svg` + : `${ WC_BLOCKS_IMAGE_URL }blocks/mini-cart/cart-drawer.svg` } alt="" />