Skip to content

Commit

Permalink
Update: Use offsite navigation editor component on the navigation ins…
Browse files Browse the repository at this point in the history
…pector.
  • Loading branch information
jorgefilipecosta committed Dec 16, 2022
1 parent 5e00414 commit 81f1947
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import {
__experimentalListView as ListView,
__experimentalOffCanvasEditor as OffCanvasEditor,
store as blockEditorStore,
} from '@wordpress/block-editor';
import { useEffect } from '@wordpress/element';
Expand Down Expand Up @@ -48,5 +49,14 @@ export default function NavigationMenu( { innerBlocks, id } ) {
}
} );
}, [ updateBlockListSettings, innerBlocks ] );

if ( window?.__experimentalEnableOffCanvasNavigationEditor ) {
return (
<OffCanvasEditor
blocks={ innerBlocks }
selectBlockInCanvas={ false }
/>
);
}
return <ListView id={ id } />;
}

0 comments on commit 81f1947

Please sign in to comment.