From f130e99ac69f4ce2cb9285363967975f96994e0f Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Mon, 22 Jul 2024 20:04:46 +0200 Subject: [PATCH] Update: Simplify and do not pass renderingMode on editor SidebarContent. (#63814) Co-authored-by: jorgefilipecosta Co-authored-by: youknowriad --- packages/editor/src/components/sidebar/index.js | 7 ++----- .../editor/src/components/template-content-panel/index.js | 5 +++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/editor/src/components/sidebar/index.js b/packages/editor/src/components/sidebar/index.js index dbd33459b7f0f8..efca709e0eec75 100644 --- a/packages/editor/src/components/sidebar/index.js +++ b/packages/editor/src/components/sidebar/index.js @@ -51,7 +51,6 @@ const SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( { const SidebarContent = ( { tabName, keyboardShortcut, - renderingMode, onActionPerformed, extraPanels, } ) => { @@ -112,7 +111,7 @@ const SidebarContent = ( { - + @@ -129,7 +128,7 @@ const SidebarContent = ( { const Sidebar = ( { extraPanels, onActionPerformed } ) => { useAutoSwitchEditorSidebars(); - const { tabName, keyboardShortcut, showSummary, renderingMode } = useSelect( + const { tabName, keyboardShortcut, showSummary } = useSelect( ( select ) => { const shortcut = select( keyboardShortcutsStore @@ -158,7 +157,6 @@ const Sidebar = ( { extraPanels, onActionPerformed } ) => { TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, ].includes( select( editorStore ).getCurrentPostType() ), - renderingMode: select( editorStore ).getRenderingMode(), }; }, [] @@ -185,7 +183,6 @@ const Sidebar = ( { extraPanels, onActionPerformed } ) => { tabName={ tabName } keyboardShortcut={ keyboardShortcut } showSummary={ showSummary } - renderingMode={ renderingMode } onActionPerformed={ onActionPerformed } extraPanels={ extraPanels } /> diff --git a/packages/editor/src/components/template-content-panel/index.js b/packages/editor/src/components/template-content-panel/index.js index 14532387ecd059..47d9ab9f2e4067 100644 --- a/packages/editor/src/components/template-content-panel/index.js +++ b/packages/editor/src/components/template-content-panel/index.js @@ -27,9 +27,9 @@ const PAGE_CONTENT_BLOCKS = [ const TEMPLATE_PART_BLOCK = 'core/template-part'; -export default function TemplateContentPanel( { renderingMode } ) { +export default function TemplateContentPanel() { const { enableComplementaryArea } = useDispatch( interfaceStore ); - const { clientIds, postType } = useSelect( ( select ) => { + const { clientIds, postType, renderingMode } = useSelect( ( select ) => { const { getBlocksByName } = select( blockEditorStore ); const { getCurrentPostType } = select( editorStore ); const _postType = getCurrentPostType(); @@ -40,6 +40,7 @@ export default function TemplateContentPanel( { renderingMode } ) { ? TEMPLATE_PART_BLOCK : PAGE_CONTENT_BLOCKS ), + renderingMode: select( editorStore ).getRenderingMode(), }; }, [] );