From 06c704e727944949ad797c63a70c52c9fa4a8d63 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Wed, 26 Jul 2023 09:21:57 +0400 Subject: [PATCH] Site Editor: Remove unnecessary selector from 'PageTemplates' (#52903) --- .../src/components/page-templates/index.js | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/packages/edit-site/src/components/page-templates/index.js b/packages/edit-site/src/components/page-templates/index.js index 3246d0fe884b7..5b0a306fa7fef 100644 --- a/packages/edit-site/src/components/page-templates/index.js +++ b/packages/edit-site/src/components/page-templates/index.js @@ -8,8 +8,7 @@ import { __experimentalVStack as VStack, } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; -import { useSelect } from '@wordpress/data'; -import { store as coreStore, useEntityRecords } from '@wordpress/core-data'; +import { useEntityRecords } from '@wordpress/core-data'; import { decodeEntities } from '@wordpress/html-entities'; /** @@ -21,7 +20,6 @@ import Link from '../routes/link'; import AddedBy from '../list/added-by'; import TemplateActions from '../template-actions'; import AddNewTemplate from '../add-new-template'; -import { store as editSiteStore } from '../../store'; export default function PageTemplates() { const { records: templates } = useEntityRecords( @@ -32,15 +30,6 @@ export default function PageTemplates() { } ); - const { canCreate } = useSelect( ( select ) => { - const { supportsTemplatePartsMode } = - select( editSiteStore ).getSettings(); - return { - postType: select( coreStore ).getPostType( 'wp_template' ), - canCreate: ! supportsTemplatePartsMode, - }; - } ); - const columns = [ { header: __( 'Template' ), @@ -89,13 +78,11 @@ export default function PageTemplates() { - ) + } > { templates && }