diff --git a/plugins/woocommerce-blocks/assets/js/blocks/featured-category/block.js b/plugins/woocommerce-blocks/assets/js/blocks/featured-category/block.js index 482bf289d2b..66bfcb20576 100644 --- a/plugins/woocommerce-blocks/assets/js/blocks/featured-category/block.js +++ b/plugins/woocommerce-blocks/assets/js/blocks/featured-category/block.js @@ -32,6 +32,7 @@ import { folderStarred } from '@woocommerce/icons'; import { Icon } from '@wordpress/icons'; import ProductCategoryControl from '@woocommerce/editor-components/product-category-control'; import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder'; +import TextToolbarButton from '@woocommerce/editor-components/text-toolbar-button'; /** * Internal dependencies @@ -90,18 +91,29 @@ const FeaturedCategory = ( { setAttributes( { contentAlign: nextAlign } ); } } /> - { - setAttributes( { - mediaId: media.id, - mediaSrc: media.url, - } ); - } } - allowedTypes={ [ 'image' ] } - /> + + { + setAttributes( { + mediaId: media.id, + mediaSrc: media.url, + } ); + } } + allowedTypes={ [ 'image' ] } + /> + { mediaId && mediaSrc ? ( + + setAttributes( { mediaId: 0, mediaSrc: '' } ) + } + > + { __( 'Remove', 'woo-gutenberg-products-block' ) } + + ) : null } +