@@ -5,6 +5,7 @@ import { __ } from '@wordpress/i18n';
55import { useQueryStateByKey } from '@woocommerce/base-hooks' ;
66import { useMemo , Fragment } from '@wordpress/element' ;
77import classnames from 'classnames' ;
8+ import PropTypes from 'prop-types' ;
89
910/**
1011 * Internal dependencies
@@ -19,7 +20,7 @@ import ActiveAttributeFilters from './active-attribute-filters';
1920 */
2021const ActiveFiltersBlock = ( {
2122 attributes : blockAttributes ,
22- isPreview = false ,
23+ isEditor = false ,
2324} ) => {
2425 const [ productAttributes , setProductAttributes ] = useQueryStateByKey (
2526 'attributes' ,
@@ -65,7 +66,7 @@ const ActiveFiltersBlock = ( {
6566 ) ;
6667 } ;
6768
68- if ( ! hasFilters ( ) && ! isPreview ) {
69+ if ( ! hasFilters ( ) && ! isEditor ) {
6970 return null ;
7071 }
7172
@@ -77,12 +78,12 @@ const ActiveFiltersBlock = ( {
7778
7879 return (
7980 < Fragment >
80- { ! isPreview && blockAttributes . heading && (
81+ { ! isEditor && blockAttributes . heading && (
8182 < TagName > { blockAttributes . heading } </ TagName >
8283 ) }
8384 < div className = "wc-block-active-filters" >
8485 < ul className = { listClasses } >
85- { isPreview ? (
86+ { isEditor ? (
8687 < Fragment >
8788 { renderRemovableListItem (
8889 __ ( 'Size' , 'woo-gutenberg-products-block' ) ,
@@ -115,4 +116,15 @@ const ActiveFiltersBlock = ( {
115116 ) ;
116117} ;
117118
119+ ActiveFiltersBlock . propTypes = {
120+ /**
121+ * The attributes for this block.
122+ */
123+ attributes : PropTypes . object . isRequired ,
124+ /**
125+ * Whether it's in the editor or frontend display.
126+ */
127+ isEditor : PropTypes . bool ,
128+ } ;
129+
118130export default ActiveFiltersBlock ;
0 commit comments