Skip to content

Commit

Permalink
Replace store name string with store definition (#27182)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelgallani authored Nov 24, 2020
1 parent 0b2989f commit e2ffa92
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import { useEntityBlockEditor } from '@wordpress/core-data';
* Internal dependencies
*/
import { KIND, POST_TYPE } from '../../store/utils';
import { store as editNavigationStore } from '../../store';

export default function useNavigationBlockEditor( post ) {
const { createMissingMenuItems } = useDispatch( 'core/edit-navigation' );
const { createMissingMenuItems } = useDispatch( editNavigationStore );

const [ blocks, onInput, _onChange ] = useEntityBlockEditor(
KIND,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
import { useSelect, useDispatch } from '@wordpress/data';
import { useState, useEffect } from '@wordpress/element';

/**
* Internal dependencies
*/
import { store as editNavigationStore } from '../../store';

export default function useNavigationEditor() {
const menus = useSelect(
( select ) => select( 'core' ).getMenus( { per_page: -1 } ),
Expand All @@ -20,7 +25,7 @@ export default function useNavigationEditor() {

const navigationPost = useSelect(
( select ) =>
select( 'core/edit-navigation' ).getNavigationPostForMenu(
select( editNavigationStore ).getNavigationPostForMenu(
selectedMenuId
),
[ selectedMenuId ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ import { useDispatch } from '@wordpress/data';
import { Button } from '@wordpress/components';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import { store as editNavigationStore } from '../../store';

export default function SaveButton( { navigationPost } ) {
const { saveNavigationPost } = useDispatch( 'core/edit-navigation' );
const { saveNavigationPost } = useDispatch( editNavigationStore );

return (
<Button
Expand Down

0 comments on commit e2ffa92

Please sign in to comment.