diff --git a/packages/edit-site/src/components/app/index.js b/packages/edit-site/src/components/app/index.js index 8742739d64e67c..133a376c9c246d 100644 --- a/packages/edit-site/src/components/app/index.js +++ b/packages/edit-site/src/components/app/index.js @@ -20,7 +20,7 @@ import { unlock } from '../../lock-unlock'; import { useCommonCommands } from '../../hooks/commands/use-common-commands'; import { useEditModeCommands } from '../../hooks/commands/use-edit-mode-commands'; import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url'; -import useLayoutAreas from '../layout/router'; +import useActiveRoute from '../layout/router'; import useSetCommandContext from '../../hooks/commands/use-set-command-context'; import { useRegisterSiteEditorRoutes } from '../site-editor-routes'; @@ -34,7 +34,7 @@ function AppLayout() { useCommonCommands(); useSetCommandContext(); useRegisterSiteEditorRoutes(); - const route = useLayoutAreas(); + const route = useActiveRoute(); return ; } diff --git a/packages/edit-site/src/components/layout/router.js b/packages/edit-site/src/components/layout/router.js index ad245d660a4ffb..912a837555e0d1 100644 --- a/packages/edit-site/src/components/layout/router.js +++ b/packages/edit-site/src/components/layout/router.js @@ -78,7 +78,7 @@ export default function useActiveRoute() { } return { - key: matchedRoute.name, + name: matchedRoute.name, areas: matchedRoute.areas, widths: matchedRoute.widths, }; diff --git a/packages/edit-site/src/components/posts-app/index.js b/packages/edit-site/src/components/posts-app/index.js index 12bdf33711031c..8b5377bb2e65bd 100644 --- a/packages/edit-site/src/components/posts-app/index.js +++ b/packages/edit-site/src/components/posts-app/index.js @@ -12,7 +12,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router'; */ import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url'; import Layout from '../layout'; -import useLayoutAreas from './router'; +import useActiveRoute from './router'; import { unlock } from '../../lock-unlock'; const { RouterProvider } = unlock( routerPrivateApis ); @@ -21,7 +21,7 @@ const { GlobalStylesProvider } = unlock( editorPrivateApis ); function PostsLayout() { // This ensures the edited entity id and type are initialized properly. useInitEditedEntityFromURL(); - const route = useLayoutAreas(); + const route = useActiveRoute(); return ; } diff --git a/packages/edit-site/src/components/posts-app/router.js b/packages/edit-site/src/components/posts-app/router.js index 5ffbe1831f2a24..de89567b262094 100644 --- a/packages/edit-site/src/components/posts-app/router.js +++ b/packages/edit-site/src/components/posts-app/router.js @@ -17,7 +17,7 @@ import PostList from '../post-list'; const { useLocation } = unlock( routerPrivateApis ); -export default function useLayoutAreas() { +export default function useActiveRoute() { const { params = {} } = useLocation(); const { postType, layout, canvas } = params; const labels = useSelect( @@ -31,7 +31,7 @@ export default function useLayoutAreas() { if ( [ 'post' ].includes( postType ) ) { const isListLayout = layout === 'list' || ! layout; return { - key: 'posts-list', + name: 'posts-list', areas: { sidebar: ( , preview: ,