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:
parent
6fa048cf62
commit
fadb56f06b
|
@ -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 }
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue