UNPKG

@wordpress/edit-post

Version:
33 lines (31 loc) 818 B
import { createElement } from "@wordpress/element"; /** * WordPress dependencies */ import { MenuItem } from '@wordpress/components'; import { withDispatch } from '@wordpress/data'; import { __ } from '@wordpress/i18n'; import { displayShortcut } from '@wordpress/keycodes'; /** * Internal dependencies */ import { store as editPostStore } from '../../store'; export function KeyboardShortcutsHelpMenuItem({ openModal }) { return createElement(MenuItem, { onClick: () => { openModal('edit-post/keyboard-shortcut-help'); }, shortcut: displayShortcut.access('h') }, __('Keyboard shortcuts')); } export default withDispatch(dispatch => { const { openModal } = dispatch(editPostStore); return { openModal }; })(KeyboardShortcutsHelpMenuItem); //# sourceMappingURL=index.js.map