Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
gigitux committed Dec 29, 2021
1 parent 30503a5 commit af20a74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions assets/js/blocks/active-filters/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { InspectorControls } from '@wordpress/block-editor';
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
import { Disabled, PanelBody, withSpokenMessages } from '@wordpress/components';
import HeadingToolbar from '@woocommerce/editor-components/heading-toolbar';
import BlockTitle from '@woocommerce/editor-components/block-title';
Expand All @@ -18,6 +18,10 @@ import { getTextColorClassAndStyleFromAttributeObject } from '../../utils/style-
const Edit = ( { attributes, setAttributes } ) => {
const { className, displayStyle, heading, headingLevel } = attributes;

const blockProps = useBlockProps( {
className,
} );

const textColorClassAndStyle = getTextColorClassAndStyleFromAttributeObject(
attributes
);
Expand Down Expand Up @@ -81,7 +85,7 @@ const Edit = ( { attributes, setAttributes } ) => {
};

return (
<div className={ className }>
<div { ...blockProps }>
{ getInspectorControls() }
<BlockTitle
className={ classNames(
Expand Down
6 changes: 5 additions & 1 deletion assets/js/blocks/active-filters/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { __ } from '@wordpress/i18n';
import { registerBlockType } from '@wordpress/blocks';
import { Icon, toggle } from '@woocommerce/icons';
import classNames from 'classnames';
import { useBlockProps } from '@wordpress/block-editor';

/**
* Internal dependencies
Expand Down Expand Up @@ -62,9 +63,12 @@ registerBlockType( 'woocommerce/active-filters', {
'data-heading': heading,
'data-heading-level': headingLevel,
};

return (
<div
className={ classNames( 'is-loading', className ) }
{ ...useBlockProps.save( {
className: classNames( 'is-loading', className ),
} ) }
{ ...data }
>
<span
Expand Down

0 comments on commit af20a74

Please sign in to comment.