UNPKG

@wordpress/edit-post

Version:
32 lines (27 loc) 617 B
/** * WordPress dependencies */ import { MenuItem } from '@wordpress/components'; import { withDispatch } from '@wordpress/data'; import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ import { store as editPostStore } from '../../store'; export function ManageBlocksMenuItem( { openModal } ) { return ( <MenuItem onClick={ () => { openModal( 'edit-post/manage-blocks' ); } } > { __( 'Block Manager' ) } </MenuItem> ); } export default withDispatch( ( dispatch ) => { const { openModal } = dispatch( editPostStore ); return { openModal, }; } )( ManageBlocksMenuItem );