From 6abcd284389050d4024381a2126fc95fe46321c8 Mon Sep 17 00:00:00 2001 From: David Szabo Date: Mon, 18 Jan 2021 14:45:15 +0100 Subject: [PATCH] Remove general templates from pages --- .../navigation-panel/menus/templates-pages.js | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/packages/edit-site/src/components/navigation-sidebar/navigation-panel/menus/templates-pages.js b/packages/edit-site/src/components/navigation-sidebar/navigation-panel/menus/templates-pages.js index d4816219a0239..363c86fd18575 100644 --- a/packages/edit-site/src/components/navigation-sidebar/navigation-panel/menus/templates-pages.js +++ b/packages/edit-site/src/components/navigation-sidebar/navigation-panel/menus/templates-pages.js @@ -6,11 +6,8 @@ import { map } from 'lodash'; /** * WordPress dependencies */ -import { - __experimentalNavigationGroup as NavigationGroup, - __experimentalNavigationMenu as NavigationMenu, -} from '@wordpress/components'; -import { __, _x } from '@wordpress/i18n'; +import { __experimentalNavigationMenu as NavigationMenu } from '@wordpress/components'; +import { __ } from '@wordpress/i18n'; /** * Internal dependencies @@ -19,7 +16,6 @@ import TemplateNavigationItem from '../template-navigation-item'; import { MENU_TEMPLATES, MENU_TEMPLATES_PAGES } from '../constants'; export default function TemplatesPagesMenu( { templates } ) { - const defaultTemplate = templates?.find( ( { slug } ) => slug === 'page' ); const specificTemplates = templates?.filter( ( { slug } ) => slug.startsWith( 'page-' ) ) ?? []; @@ -28,22 +24,14 @@ export default function TemplatesPagesMenu( { templates } ) { menu={ MENU_TEMPLATES_PAGES } title={ __( 'Pages' ) } parentMenu={ MENU_TEMPLATES } - isEmpty={ ! defaultTemplate && specificTemplates.length === 0 } + isEmpty={ specificTemplates.length === 0 } > - - { map( specificTemplates, ( template ) => ( - - ) ) } - - - { defaultTemplate && ( - - - - ) } + { map( specificTemplates, ( template ) => ( + + ) ) } ); }