diff --git a/assets/js/blocks/featured-product/block.js b/assets/js/blocks/featured-product/block.js index 3c64c9c2951..d463958986b 100644 --- a/assets/js/blocks/featured-product/block.js +++ b/assets/js/blocks/featured-product/block.js @@ -31,6 +31,7 @@ import PropTypes from 'prop-types'; import { getSetting } from '@woocommerce/settings'; import ProductControl from '@woocommerce/editor-components/product-control'; import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder'; +import TextToolbarButton from '@woocommerce/editor-components/text-toolbar-button'; import { withProduct } from '@woocommerce/block-hocs'; import { Icon, starEmpty } from '@wordpress/icons'; @@ -138,19 +139,29 @@ const FeaturedProduct = ( { 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: '' } ) + } + > + { __( 'Reset', 'woo-gutenberg-products-block' ) } + + ) : null } +