Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function ToolSelector() {
const isNavigationTool = useSelect( ( select ) => select( 'core/block-editor' ).isNavigationMode(), [] );
const { setNavigationMode } = useDispatch( 'core/block-editor' );
const isMediumViewport = useViewportMatch( 'medium' );
if ( ! isMediumViewport ) {
return null;
}
const onSwitchMode = ( mode ) => {
setNavigationMode( mode === 'edit' ? false : true );
};
return (
(
function Layout() {
const isMobileViewport = useViewportMatch( 'small', '<' );
const { closePublishSidebar, togglePublishSidebar } = useDispatch( 'core/edit-post' );
const {
mode,
isRichEditingEnabled,
editorSidebarOpened,
pluginSidebarOpened,
publishSidebarOpened,
hasActiveMetaboxes,
isSaving,
hasFixedToolbar,
previousShortcut,
nextShortcut,
} = useSelect( ( select ) => {
return ( {
hasFixedToolbar: select( 'core/edit-post' ).isFeatureActive( 'fixedToolbar' ),
editorSidebarOpened: select( 'core/edit-post' ).isEditorSidebarOpened(),