Skip to content

Commit

Permalink
Only show chevrons for pages and posts in the navigation menu, as the…
Browse files Browse the repository at this point in the history
…se are the only items that will have a submenu in the navigation site editor menu.
  • Loading branch information
apeatling committed May 1, 2023
1 parent 39b24dc commit 5e0994a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ function ListViewBlockSelectButton(
)
: __( 'Edit' );

const hasChevron = [ 'core/navigation-submenu', 'post', 'page' ].includes(
blockInformation.name
);

return (
<>
<Button
Expand Down Expand Up @@ -119,11 +123,13 @@ function ListViewBlockSelectButton(
<Icon icon={ lock } />
</span>
) }
<Icon
icon={ chevronRightSmall }
className="block-editor-list-view-block-select-button__drilldown-indicator"
size={ 24 }
/>
{ hasChevron && (
<Icon
icon={ chevronRightSmall }
className="block-editor-list-view-block-select-button__drilldown-indicator"
size={ 24 }
/>
) }
</HStack>
</Button>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 ]
Expand Down

0 comments on commit 5e0994a

Please sign in to comment.