From 15e87480c684f5f61f9262cb0ac62d45f055b108 Mon Sep 17 00:00:00 2001 From: Niels Lange Date: Tue, 20 Jun 2023 11:52:53 +0200 Subject: [PATCH] Reference Mini Cart drawer preview dynamically (#9912) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Reference Mini Cart drawer preview dynamically * Update assets/js/blocks/mini-cart/edit.tsx Co-authored-by: Albert Juhé Lluveras --------- Co-authored-by: Albert Juhé Lluveras --- 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 e125aa5b7b5..dd72dd190a6 100644 --- a/assets/js/blocks/mini-cart/edit.tsx +++ b/assets/js/blocks/mini-cart/edit.tsx @@ -19,6 +19,7 @@ import type { ReactElement } from 'react'; import { select } from '@wordpress/data'; import { cartOutline, bag, bagAlt } from '@woocommerce/icons'; import { Icon } from '@wordpress/icons'; +import { WC_BLOCKS_IMAGE_URL } from '@woocommerce/block-settings'; /** * Internal dependencies @@ -163,8 +164,8 @@ const Edit = ( { attributes, setAttributes }: Props ): ReactElement => { 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="" />