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
  • Loading branch information
ntsekouras committed May 19, 2023
1 parent 064f731 commit 864e551
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

0 comments on commit 864e551

Please sign in to comment.