Skip to content

Commit

Permalink
Navigation Editor: move the delete menu button at the bottom (#31026)
Browse files Browse the repository at this point in the history
Update message in the alert modal.
  • Loading branch information
Mamaduka authored Apr 23, 2021
1 parent 2cb11b0 commit 47f1147
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export default function DeleteMenu( { onDeleteMenu, isMenuBeingDeleted } ) {
if (
// eslint-disable-next-line no-alert
window.confirm(
__( 'Are you sure you want to delete this navigation?' )
__(
'Are you sure you want to delete this navigation? This action cannot be undone.'
)
)
) {
onDeleteMenu();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
* WordPress dependencies
*/
import { useSelect } from '@wordpress/data';
import { InspectorControls } from '@wordpress/block-editor';
import {
InspectorControls,
store as blockEditorStore,
} from '@wordpress/block-editor';

/**
* Internal dependencies
Expand All @@ -25,7 +28,7 @@ export default function InspectorAdditions( {
openManageLocationsModal,
} ) {
const selectedBlock = useSelect(
( select ) => select( 'core/block-editor' ).getSelectedBlock(),
( select ) => select( blockEditorStore ).getSelectedBlock(),
[]
);

Expand All @@ -38,10 +41,6 @@ export default function InspectorAdditions( {
<PanelBody title={ __( 'Menu settings' ) }>
<NameEditor />
<AutoAddPages menuId={ menuId } />
<DeleteMenu
onDeleteMenu={ onDeleteMenu }
isMenuBeingDeleted={ isMenuBeingDeleted }
/>
</PanelBody>
<PanelBody title={ __( 'Theme locations' ) }>
<ManageLocations
Expand All @@ -53,6 +52,12 @@ export default function InspectorAdditions( {
openModal={ openManageLocationsModal }
/>
</PanelBody>
<PanelBody>
<DeleteMenu
onDeleteMenu={ onDeleteMenu }
isMenuBeingDeleted={ isMenuBeingDeleted }
/>
</PanelBody>
</InspectorControls>
);
}

0 comments on commit 47f1147

Please sign in to comment.