UNPKG

801 BJavaScriptView Raw
1import { createElement } from "@wordpress/element";
2
3/**
4 * External dependencies
5 */
6import { flow } from 'lodash';
7/**
8 * WordPress dependencies
9 */
10
11import { MenuItem } from '@wordpress/components';
12import { withDispatch } from '@wordpress/data';
13import { __ } from '@wordpress/i18n';
14export function ManageBlocksMenuItem(_ref) {
15 var onSelect = _ref.onSelect,
16 openModal = _ref.openModal;
17 return createElement(MenuItem, {
18 onClick: flow([onSelect, function () {
19 return openModal('edit-post/manage-blocks');
20 }])
21 }, __('Block Manager'));
22}
23export default withDispatch(function (dispatch) {
24 var _dispatch = dispatch('core/edit-post'),
25 openModal = _dispatch.openModal;
26
27 return {
28 openModal: openModal
29 };
30})(ManageBlocksMenuItem);
31//# sourceMappingURL=index.js.map
\No newline at end of file