Skip to content

Commit

Permalink
Site Editor navigation: Add corresponding area icon to template part …
Browse files Browse the repository at this point in the history
…menu items (#50791)
  • Loading branch information
ntsekouras authored May 19, 2023
1 parent c689d9f commit 3b71878
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useEntityRecords } from '@wordpress/core-data';
import { useSelect } from '@wordpress/data';
import { decodeEntities } from '@wordpress/html-entities';
import { useViewportMatch } from '@wordpress/compose';
import { getTemplatePartIcon } from '@wordpress/editor';

/**
* Internal dependencies
Expand Down Expand Up @@ -83,7 +84,7 @@ export default function SidebarNavigationScreenTemplates() {
} );

const canCreate = ! isMobileViewport && ! isTemplatePartsMode;

const isTemplateList = postType === 'wp_template';
return (
<SidebarNavigationScreen
isRoot={ isTemplatePartsMode }
Expand Down Expand Up @@ -115,6 +116,10 @@ export default function SidebarNavigationScreenTemplates() {
postId={ template.id }
key={ template.id }
withChevron
icon={
! isTemplateList &&
getTemplatePartIcon( template.area )
}
>
{ decodeEntities(
template.title?.rendered ||
Expand Down

1 comment on commit 3b71878

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 3b71878.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5027736620
📝 Reported issues:

Please sign in to comment.