Skip to content

Commit

Permalink
Navigation Editor: show all menus in locations (#29906)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrei Draganescu <[email protected]>
  • Loading branch information
draganescu and Andrei Draganescu authored Mar 17, 2021
1 parent a7474b1 commit ef33e93
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion packages/edit-navigation/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ export default function Header( {
{ __( 'Manage locations' ) }
</Button>
) }
renderContent={ () => <ManageLocations /> }
renderContent={ () => (
<ManageLocations menus={ menus } />
) }
/>

<SaveButton navigationPost={ navigationPost } />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* WordPress dependencies
*/
import { useSelect } from '@wordpress/data';
import { Spinner, SelectControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';

Expand All @@ -10,9 +9,7 @@ import { __ } from '@wordpress/i18n';
*/
import useMenuLocations from '../../hooks/use-menu-locations';

export default function ManageLocations() {
const menus = useSelect( ( select ) => select( 'core' ).getMenus(), [] );

export default function ManageLocations( { menus } ) {
const [ menuLocations, assignMenuToLocation ] = useMenuLocations();

if ( ! menus || ! menuLocations ) {
Expand Down

0 comments on commit ef33e93

Please sign in to comment.