tipus/editor/BlockEditor.jsx

30 lines
900 B
JavaScript

import { useSelect } from '@wordpress/data';
import { InterfaceSkeleton, FullscreenMode, ComplementaryArea } from '@wordpress/interface';
import { BlockBreadcrumb, BlockCanvas, store as blockEditorStore } from '@wordpress/block-editor';
import Header from './Header';
import Sidebar from './Sidebar';
import { scope } from './constants';
export default function BlockEditor() {
const { styles } = useSelect(( select ) => {
const { getSettings, getBlockSelectionStart } = select( blockEditorStore );
return {
styles: getSettings().styles,
};
}, []);
return (
<>
<FullscreenMode isActive={ true } />
<Sidebar />
<InterfaceSkeleton
header={ <Header /> }
content={ <BlockCanvas height="100%" styles={styles} /> }
sidebar={ <ComplementaryArea.Slot scope={ scope } /> }
footer={ <BlockBreadcrumb /> }
/>
</>
);
}