From 5e0994a96773621b5957ed2b2df716d44e7e9631 Mon Sep 17 00:00:00 2001 From: apeatling Date: Mon, 1 May 2023 09:55:14 -0700 Subject: [PATCH] Only show chevrons for pages and posts in the navigation menu, as these are the only items that will have a submenu in the navigation site editor menu. --- .../off-canvas-editor/block-select-button.js | 16 +++++++++++----- .../use-block-display-information/index.js | 3 +++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/block-editor/src/components/off-canvas-editor/block-select-button.js b/packages/block-editor/src/components/off-canvas-editor/block-select-button.js index 55694847e56fbf..07be2a992c2549 100644 --- a/packages/block-editor/src/components/off-canvas-editor/block-select-button.js +++ b/packages/block-editor/src/components/off-canvas-editor/block-select-button.js @@ -70,6 +70,10 @@ function ListViewBlockSelectButton( ) : __( 'Edit' ); + const hasChevron = [ 'core/navigation-submenu', 'post', 'page' ].includes( + blockInformation.name + ); + return ( <> diff --git a/packages/block-editor/src/components/use-block-display-information/index.js b/packages/block-editor/src/components/use-block-display-information/index.js index 950cb9c905b24c..d910bbc1690bbe 100644 --- a/packages/block-editor/src/components/use-block-display-information/index.js +++ b/packages/block-editor/src/components/use-block-display-information/index.js @@ -57,12 +57,14 @@ export default function useBlockDisplayInformation( clientId ) { const match = getActiveBlockVariation( blockName, attributes ); const isSynced = isReusableBlock( blockType ) || isTemplatePart( blockType ); + const blockTypeInfo = { isSynced, title: blockType.title, icon: blockType.icon, description: blockType.description, anchor: attributes?.anchor, + name: blockType.name, }; if ( ! match ) return blockTypeInfo; @@ -72,6 +74,7 @@ export default function useBlockDisplayInformation( clientId ) { icon: match.icon || blockType.icon, description: match.description || blockType.description, anchor: attributes?.anchor, + name: match.name || blockType.name, }; }, [ clientId ]