diff --git a/packages/edit-navigation/src/components/layout/index.js b/packages/edit-navigation/src/components/layout/index.js index 9be2cfa8c6bd2..74acf52d187bc 100644 --- a/packages/edit-navigation/src/components/layout/index.js +++ b/packages/edit-navigation/src/components/layout/index.js @@ -69,9 +69,6 @@ export default function Layout( { blockEditorSettings } ) { isMenuBeingDeleted, selectMenu, deleteMenu, - openManageLocationsModal, - closeManageLocationsModal, - isManageLocationsModalOpen, isMenuSelected, } = useNavigationEditor(); @@ -193,15 +190,6 @@ export default function Layout( { blockEditorSettings } ) { onDeleteMenu={ deleteMenu } isMenuBeingDeleted={ isMenuBeingDeleted } hasPermanentSidebar={ hasPermanentSidebar } - isManageLocationsModalOpen={ - isManageLocationsModalOpen - } - openManageLocationsModal={ - openManageLocationsModal - } - closeManageLocationsModal={ - closeManageLocationsModal - } /> diff --git a/packages/edit-navigation/src/components/sidebar/index.js b/packages/edit-navigation/src/components/sidebar/index.js index c7b2c60660f34..4123ef911e146 100644 --- a/packages/edit-navigation/src/components/sidebar/index.js +++ b/packages/edit-navigation/src/components/sidebar/index.js @@ -29,9 +29,6 @@ export default function Sidebar( { isMenuBeingDeleted, onDeleteMenu, onSelectMenu, - isManageLocationsModalOpen, - closeManageLocationsModal, - openManageLocationsModal, hasPermanentSidebar, } ) { const { sidebar, hasBlockSelection, hasSidebarEnabled } = useSelect( @@ -94,9 +91,6 @@ export default function Sidebar( { menus={ menus } selectedMenuId={ menuId } onSelectMenu={ onSelectMenu } - isModalOpen={ isManageLocationsModalOpen } - closeModal={ closeManageLocationsModal } - openModal={ openManageLocationsModal } /> setIsModalOpen( true ); + const closeModal = () => setIsModalOpen( false ); if ( ! menuLocations || ! menus?.length ) { return ; diff --git a/packages/edit-navigation/src/hooks/use-navigation-editor.js b/packages/edit-navigation/src/hooks/use-navigation-editor.js index 2112582a29c94..cec78cf3a59dc 100644 --- a/packages/edit-navigation/src/hooks/use-navigation-editor.js +++ b/packages/edit-navigation/src/hooks/use-navigation-editor.js @@ -24,14 +24,6 @@ const getMenusData = ( select ) => { }; }; export default function useNavigationEditor() { - const [ - isManageLocationsModalOpen, - setIsManageLocationsModalOpen, - ] = useState( false ); - const [ openManageLocationsModal, closeManageLocationsModal ] = [ - true, - false, - ].map( ( bool ) => () => setIsManageLocationsModalOpen( bool ) ); const { deleteMenu: _deleteMenu } = useDispatch( coreStore ); const [ selectedMenuId, setSelectedMenuId ] = useSelectedMenuId(); const [ hasFinishedInitialLoad, setHasFinishedInitialLoad ] = useState( @@ -101,9 +93,6 @@ export default function useNavigationEditor() { isMenuBeingDeleted, selectMenu: setSelectedMenuId, deleteMenu, - openManageLocationsModal, - closeManageLocationsModal, - isManageLocationsModalOpen, isMenuSelected: !! selectedMenuId, }; }