From ebc797bc5ced6f2fd5b591865bd62264e6f1d9b8 Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Fri, 3 Mar 2023 14:21:57 +0000 Subject: [PATCH] Fix: Custom link UI does appears outside canvas on the sidebar navigation. (#48633) --- .../index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js index 548a412405e443..e4690b9448db83 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js @@ -20,6 +20,7 @@ import NavigationMenuContent from './navigation-menu-content'; import SidebarButton from '../sidebar-button'; import { NavigationMenuLoader } from './loader'; import { unlock } from '../../private-apis'; +import { store as editSiteStore } from '../../store'; const noop = () => {}; const NAVIGATION_MENUS_QUERY = { per_page: -1, status: 'publish' }; @@ -44,8 +45,9 @@ const prioritizedInserterBlocks = [ export default function SidebarNavigationScreenNavigationMenus() { const history = useHistory(); - const { navigationMenus, hasResolvedNavigationMenus } = useSelect( - ( select ) => { + const { navigationMenus, hasResolvedNavigationMenus, storedSettings } = + useSelect( ( select ) => { + const { getSettings } = unlock( select( editSiteStore ) ); const { getEntityRecords, hasFinishedResolution } = select( coreStore ); @@ -55,15 +57,14 @@ export default function SidebarNavigationScreenNavigationMenus() { NAVIGATION_MENUS_QUERY, ]; return { + storedSettings: getSettings( false ), navigationMenus: getEntityRecords( ...navigationMenusQuery ), hasResolvedNavigationMenus: hasFinishedResolution( 'getEntityRecords', navigationMenusQuery ), }; - }, - [] - ); + }, [] ); // Sort navigation menus by date. const orderedNavigationMenus = useMemo( @@ -133,6 +134,7 @@ export default function SidebarNavigationScreenNavigationMenus() { const { PrivateInserter } = unlock( blockEditorPrivateApis ); return (