From 79103f124925d1f457f627e154f52a56228ed5ad Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Tue, 14 Feb 2023 10:16:29 +1300 Subject: [PATCH] Add back link to Design heading in site editor navigation to return to Dashboard (#47950) --- .../sidebar-navigation-screen/index.js | 23 ++++++++++++++++++- .../sidebar-navigation-screen/style.scss | 4 ---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/packages/edit-site/src/components/sidebar-navigation-screen/index.js b/packages/edit-site/src/components/sidebar-navigation-screen/index.js index 6e34c9f10e4f95..754508985be061 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen/index.js @@ -5,10 +5,18 @@ import { __experimentalHStack as HStack, __experimentalVStack as VStack, __experimentalNavigatorToParentButton as NavigatorToParentButton, + Button, __experimentalNavigatorScreen as NavigatorScreen, } from '@wordpress/components'; import { isRTL, __ } from '@wordpress/i18n'; import { chevronRight, chevronLeft } from '@wordpress/icons'; +import { useSelect } from '@wordpress/data'; + +/** + * Internal dependencies + */ +import { store as editSiteStore } from '../../store'; +import { unlock } from '../../private-apis'; export default function SidebarNavigationScreen( { path, @@ -16,6 +24,13 @@ export default function SidebarNavigationScreen( { actions, content, } ) { + const { dashboardLink } = useSelect( ( select ) => { + const { getSettings } = unlock( select( editSiteStore ) ); + return { + dashboardLink: getSettings().__experimentalDashboardLink, + }; + }, [] ); + return ( ) : ( -
+