From 1cfc442d7da593b98408e6776770fd91008e77bf Mon Sep 17 00:00:00 2001 From: Juan Aldasoro Date: Tue, 5 Mar 2024 14:34:04 +0100 Subject: [PATCH] Block Theme Previews: Remove "Looking for Template Parts?" hint. (#59092) * Remove template part hint. --------- Unlinked contributors: fushar. Co-authored-by: juanfra Co-authored-by: carolinan Co-authored-by: richtabor --- .../sidebar-navigation-screen-main/index.js | 2 -- .../template-part-hint.js | 34 ------------------- 2 files changed, 36 deletions(-) delete mode 100644 packages/edit-site/src/components/sidebar-navigation-screen-main/template-part-hint.js diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-main/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-main/index.js index 152139870fa59f..d6e03f3d36ccbc 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-main/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-main/index.js @@ -20,7 +20,6 @@ import SidebarNavigationItem from '../sidebar-navigation-item'; import { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles'; import { unlock } from '../../lock-unlock'; import { store as editSiteStore } from '../../store'; -import TemplatePartHint from './template-part-hint'; export default function SidebarNavigationScreenMain() { const { location } = useNavigator(); @@ -84,7 +83,6 @@ export default function SidebarNavigationScreenMain() { { __( 'Patterns' ) } - } /> diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-main/template-part-hint.js b/packages/edit-site/src/components/sidebar-navigation-screen-main/template-part-hint.js deleted file mode 100644 index c6f270465b86f3..00000000000000 --- a/packages/edit-site/src/components/sidebar-navigation-screen-main/template-part-hint.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * WordPress dependencies - */ -import { Notice } from '@wordpress/components'; -import { useDispatch, useSelect } from '@wordpress/data'; -import { __ } from '@wordpress/i18n'; -import { store as preferencesStore } from '@wordpress/preferences'; - -const PREFERENCE_NAME = 'isTemplatePartMoveHintVisible'; - -export default function TemplatePartHint() { - const showTemplatePartHint = useSelect( - ( select ) => - select( preferencesStore ).get( 'core', PREFERENCE_NAME ) ?? true, - [] - ); - - const { set: setPreference } = useDispatch( preferencesStore ); - if ( ! showTemplatePartHint ) { - return null; - } - - return ( - { - setPreference( 'core', PREFERENCE_NAME, false ); - } } - > - { __( 'Looking for template parts? Find them in "Patterns".' ) } - - ); -}