From 9f3c76cd6d2a920fc2183f94af653757f87ac781 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Tue, 27 Jun 2023 11:03:16 +0200 Subject: [PATCH] Add template part icons to the library grid items --- .../src/components/page-library/grid-item.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/edit-site/src/components/page-library/grid-item.js b/packages/edit-site/src/components/page-library/grid-item.js index 027e14ca9e946..55b723814c100 100644 --- a/packages/edit-site/src/components/page-library/grid-item.js +++ b/packages/edit-site/src/components/page-library/grid-item.js @@ -20,7 +20,13 @@ import { useInstanceId } from '@wordpress/compose'; import { useDispatch } from '@wordpress/data'; import { useState } from '@wordpress/element'; import { __, sprintf } from '@wordpress/i18n'; -import { Icon, moreHorizontal } from '@wordpress/icons'; +import { + Icon, + header, + footer, + symbolFilled, + moreHorizontal, +} from '@wordpress/icons'; import { store as noticesStore } from '@wordpress/notices'; import { store as reusableBlocksStore } from '@wordpress/reusable-blocks'; import { DELETE, BACKSPACE } from '@wordpress/keycodes'; @@ -89,6 +95,15 @@ export default function GridItem( { categoryId, composite, icon, item } ) { ariaDescription = item.description; } + let itemIcon = icon; + if ( categoryId === 'header' ) { + itemIcon = header; + } else if ( categoryId === 'footer' ) { + itemIcon = footer; + } else if ( categoryId === 'uncategorized' ) { + itemIcon = symbolFilled; + } + return ( <>
@@ -127,7 +142,7 @@ export default function GridItem( { categoryId, composite, icon, item } ) { spacing={ 3 } className="edit-site-library__pattern-title" > - { icon && } + { icon && } { item.title } { item.type === USER_PATTERNS && (