Remove manual call to enableComplementaryArea from Sidebar

There is no need for me to call this function, because
ComplementaryArea already does it for me when isActiveByDefault is
true.
This commit is contained in:
jordi fita mas 2024-06-15 03:34:54 +02:00
parent 6fa048cf62
commit fadb56f06b
1 changed files with 3 additions and 9 deletions

View File

@ -1,23 +1,17 @@
import { useSelect, useDispatch } from '@wordpress/data';
import { useSelect } from '@wordpress/data';
import { useEffect } from '@wordpress/element';
import { ComplementaryArea, store as interfaceStore } from '@wordpress/interface';
import { ComplementaryArea } from '@wordpress/interface';
import { Panel } from '@wordpress/components';
import { BlockInspector } from '@wordpress/block-editor';
import { drawerRight } from '@wordpress/icons';
import { scope } from './constants';
const SIDEBARS_BLOCK = 'tipus/block';
export default function Sidebar () {
const { enableComplementaryArea } = useDispatch( interfaceStore );
useEffect(() => {
enableComplementaryArea( scope, SIDEBARS_BLOCK );
}, []);
return (
<ComplementaryArea
scope={ scope }
identifier={ SIDEBARS_BLOCK }
identifier="tipus/block"
isActiveByDefault={ true }
icon={ drawerRight }
>