Always show the sidebar
This commit is contained in:
parent
9916afc768
commit
b6665b67ba
|
@ -6,24 +6,17 @@ import { BlockBreadcrumb, BlockCanvas, store as blockEditorStore } from '@wordpr
|
|||
import Sidebar from './Sidebar';
|
||||
|
||||
export default function BlockEditor() {
|
||||
const { styles, sidebarIsOpen, hasBlockSelected } = useSelect(( select ) => {
|
||||
const { styles } = useSelect(( select ) => {
|
||||
const { getSettings, getBlockSelectionStart } = select( blockEditorStore );
|
||||
const { getActiveComplementaryArea } = select( interfaceStore );
|
||||
return {
|
||||
styles: getSettings().styles,
|
||||
hasBlockSelected: !!getBlockSelectionStart(),
|
||||
sidebarIsOpen: !!getActiveComplementaryArea( 'tipus/editor' )
|
||||
};
|
||||
}, []);
|
||||
|
||||
const { enableComplementaryArea, disableComplementaryArea } = useDispatch( interfaceStore );
|
||||
const { enableComplementaryArea } = useDispatch( interfaceStore );
|
||||
useEffect(() => {
|
||||
if (hasBlockSelected) {
|
||||
enableComplementaryArea( 'tipus/editor', 'edit-post/block' );
|
||||
} else {
|
||||
disableComplementaryArea( 'tipus/editor' );
|
||||
}
|
||||
}, [ hasBlockSelected ]);
|
||||
enableComplementaryArea( 'tipus/editor', 'edit-post/block' );
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -31,7 +24,7 @@ export default function BlockEditor() {
|
|||
<Sidebar />
|
||||
<InterfaceSkeleton
|
||||
content={ <BlockCanvas height="100%" styles={styles} /> }
|
||||
sidebar={ sidebarIsOpen && <ComplementaryArea.Slot scope="tipus/editor" /> }
|
||||
sidebar={ <ComplementaryArea.Slot scope="tipus/editor" /> }
|
||||
footer={ <BlockBreadcrumb /> }
|
||||
/>
|
||||
</>
|
||||
|
|
Loading…
Reference in New Issue