1 | import { createElement } from "@wordpress/element";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | import { flow } from 'lodash';
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | import { MenuItem } from '@wordpress/components';
|
12 | import { withDispatch } from '@wordpress/data';
|
13 | import { __ } from '@wordpress/i18n';
|
14 | export 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 | }
|
23 | export 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 |
|
\ | No newline at end of file |