From 0af364b195e030721a01efea7cb12b45945518b7 Mon Sep 17 00:00:00 2001 From: James Koster Date: Wed, 17 Apr 2024 17:52:09 +0100 Subject: [PATCH] Remove icons in favor of dedicated field --- .../src/components/page-patterns/index.js | 33 ++----------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/packages/edit-site/src/components/page-patterns/index.js b/packages/edit-site/src/components/page-patterns/index.js index 1f8521071530cc..58ca31e39d47fe 100644 --- a/packages/edit-site/src/components/page-patterns/index.js +++ b/packages/edit-site/src/components/page-patterns/index.js @@ -26,14 +26,7 @@ import { privateApis as blockEditorPrivateApis, } from '@wordpress/block-editor'; import { DataViews, filterSortAndPaginate } from '@wordpress/dataviews'; -import { - Icon, - header, - footer, - symbolFilled as uncategorized, - symbol, - lockSmall, -} from '@wordpress/icons'; +import { Icon, lockSmall } from '@wordpress/icons'; import { usePrevious } from '@wordpress/compose'; import { useEntityRecords } from '@wordpress/core-data'; import { privateApis as editorPrivateApis } from '@wordpress/editor'; @@ -76,7 +69,6 @@ const { ExperimentalBlockEditorProvider, useGlobalStyle } = unlock( const { usePostActions } = unlock( editorPrivateApis ); const { useHistory } = unlock( routerPrivateApis ); -const templatePartIcons = { header, footer, uncategorized }; const EMPTY_ARRAY = []; const defaultConfigPerViewType = { [ LAYOUT_TABLE ]: { @@ -93,7 +85,7 @@ const DEFAULT_VIEW = { search: '', page: 1, perPage: 20, - hiddenFields: [ 'sync-status' ], + hiddenFields: [], layout: { ...defaultConfigPerViewType[ LAYOUT_GRID ], }, @@ -242,9 +234,7 @@ function Author( { item, viewType } ) { function Title( { item, categoryId } ) { const isUserPattern = item.type === PATTERN_TYPES.user; - const isNonUserPattern = item.type === PATTERN_TYPES.theme; const isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE; - let itemIcon; const { onClick } = useLink( { postType: item.type, postId: isUserPattern ? item.id : item.name, @@ -252,12 +242,6 @@ function Title( { item, categoryId } ) { categoryType: isTemplatePart ? item.type : PATTERN_TYPES.theme, canvas: 'edit', } ); - if ( ! isUserPattern && templatePartIcons[ categoryId ] ) { - itemIcon = templatePartIcons[ categoryId ]; - } else { - itemIcon = - item.syncStatus === PATTERN_SYNC_TYPES.full ? symbol : undefined; - } return ( ) } - { itemIcon && ! isNonUserPattern && ( - - - - ) } { item.type === PATTERN_TYPES.theme && (