From 79c637dc518e2a583d28fb5555928521639b6013 Mon Sep 17 00:00:00 2001 From: Mitchell Austin Date: Sun, 2 Jun 2024 19:44:30 -0700 Subject: [PATCH 1/2] Incorporate PostTypeSupportCheck in DocumentBar --- .../src/components/document-bar/index.js | 34 +++++++++++-------- .../editor/src/components/header/index.js | 9 +---- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/packages/editor/src/components/document-bar/index.js b/packages/editor/src/components/document-bar/index.js index 82603bb1c71935..be693018c8de19 100644 --- a/packages/editor/src/components/document-bar/index.js +++ b/packages/editor/src/components/document-bar/index.js @@ -29,6 +29,7 @@ import { decodeEntities } from '@wordpress/html-entities'; import { TEMPLATE_POST_TYPES, GLOBAL_POST_TYPES } from '../../store/constants'; import { store as editorStore } from '../../store'; import { unlock } from '../../lock-unlock'; +import PostTypeSupportCheck from '../post-type-support-check'; const TYPE_LABELS = { // translators: 1: Pattern title. @@ -181,20 +182,25 @@ export default function DocumentBar() { } > - - { title - ? decodeEntities( title ) - : __( 'No Title' ) } - + + + { title + ? decodeEntities( title ) + : __( 'No Title' ) } + + { displayShortcut.primary( 'k' ) } diff --git a/packages/editor/src/components/header/index.js b/packages/editor/src/components/header/index.js index 4f1df093176a7d..14b62def0cfa74 100644 --- a/packages/editor/src/components/header/index.js +++ b/packages/editor/src/components/header/index.js @@ -25,7 +25,6 @@ import MoreMenu from '../more-menu'; import PostPreviewButton from '../post-preview-button'; import PostPublishButtonOrToggle from '../post-publish-button/post-publish-button-or-toggle'; import PostSavedState from '../post-saved-state'; -import PostTypeSupportCheck from '../post-type-support-check'; import PostViewLink from '../post-view-link'; import PreviewDropdown from '../preview-dropdown'; import { store as editorStore } from '../../store'; @@ -117,13 +116,7 @@ function Header( { ! isBlockToolsCollapsed && hasTopToolbar, } ) } > - { ! title ? ( - - - - ) : ( - title - ) } + { ! title ? : title } Date: Mon, 3 Jun 2024 09:21:23 -0700 Subject: [PATCH 2/2] Remove PostTypeSupportCheck from DocumentBar --- .../src/components/document-bar/index.js | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/packages/editor/src/components/document-bar/index.js b/packages/editor/src/components/document-bar/index.js index be693018c8de19..82603bb1c71935 100644 --- a/packages/editor/src/components/document-bar/index.js +++ b/packages/editor/src/components/document-bar/index.js @@ -29,7 +29,6 @@ import { decodeEntities } from '@wordpress/html-entities'; import { TEMPLATE_POST_TYPES, GLOBAL_POST_TYPES } from '../../store/constants'; import { store as editorStore } from '../../store'; import { unlock } from '../../lock-unlock'; -import PostTypeSupportCheck from '../post-type-support-check'; const TYPE_LABELS = { // translators: 1: Pattern title. @@ -182,25 +181,20 @@ export default function DocumentBar() { } > - - - { title - ? decodeEntities( title ) - : __( 'No Title' ) } - - + + { title + ? decodeEntities( title ) + : __( 'No Title' ) } + { displayShortcut.primary( 'k' ) }