From 6740369ae044240063a70b5021abe566e02d6e17 Mon Sep 17 00:00:00 2001 From: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com> Date: Wed, 2 Nov 2022 15:46:25 +1100 Subject: [PATCH] Link to homeUrl from site editor view menu. --- .../src/components/header-edit-mode/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/edit-site/src/components/header-edit-mode/index.js b/packages/edit-site/src/components/header-edit-mode/index.js index aa2619d769a0fd..a88486a8c5981a 100644 --- a/packages/edit-site/src/components/header-edit-mode/index.js +++ b/packages/edit-site/src/components/header-edit-mode/index.js @@ -8,6 +8,7 @@ import classnames from 'classnames'; */ import { useCallback, useRef } from '@wordpress/element'; import { useViewportMatch } from '@wordpress/compose'; +import { store as coreStore } from '@wordpress/core-data'; import { ToolSelector, __experimentalPreviewOptions as PreviewOptions, @@ -50,8 +51,8 @@ export default function Header( { showIconLabels } ) { isListViewOpen, listViewShortcut, isVisualMode, - settings, blockEditorMode, + homeUrl, } = useSelect( ( select ) => { const { __experimentalGetPreviewDeviceType, @@ -59,13 +60,16 @@ export default function Header( { showIconLabels } ) { isInserterOpened, isListViewOpened, getEditorMode, - getSettings, } = select( editSiteStore ); const { getShortcutRepresentation } = select( keyboardShortcutsStore ); const { __unstableGetEditorMode } = select( blockEditorStore ); const postType = getEditedPostType(); + const { + getUnstableBase, // Site index. + } = select( coreStore ); + return { deviceType: __experimentalGetPreviewDeviceType(), templateType: postType, @@ -75,8 +79,8 @@ export default function Header( { showIconLabels } ) { 'core/edit-site/toggle-list-view' ), isVisualMode: getEditorMode() === 'visual', - settings: getSettings(), blockEditorMode: __unstableGetEditorMode(), + homeUrl: getUnstableBase()?.home, }; }, [] ); @@ -218,7 +222,7 @@ export default function Header( { showIconLabels } ) { >