Skip to content

Commit

Permalink
Update: Simplify and do not pass renderingMode on editor SidebarConte…
Browse files Browse the repository at this point in the history
…nt. (#63814)

Co-authored-by: jorgefilipecosta <[email protected]>
Co-authored-by: youknowriad <[email protected]>
  • Loading branch information
3 people authored Jul 22, 2024
1 parent 859d48b commit f130e99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 2 additions & 5 deletions packages/editor/src/components/sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {
const SidebarContent = ( {
tabName,
keyboardShortcut,
renderingMode,
onActionPerformed,
extraPanels,
} ) => {
Expand Down Expand Up @@ -112,7 +111,7 @@ const SidebarContent = ( {
<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>
<PostSummary onActionPerformed={ onActionPerformed } />
<PluginDocumentSettingPanel.Slot />
<TemplateContentPanel renderingMode={ renderingMode } />
<TemplateContentPanel />
<TemplatePartContentPanel />
<PostTransformPanel />
<PostTaxonomiesPanel />
Expand All @@ -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
Expand Down Expand Up @@ -158,7 +157,6 @@ const Sidebar = ( { extraPanels, onActionPerformed } ) => {
TEMPLATE_PART_POST_TYPE,
NAVIGATION_POST_TYPE,
].includes( select( editorStore ).getCurrentPostType() ),
renderingMode: select( editorStore ).getRenderingMode(),
};
},
[]
Expand All @@ -185,7 +183,6 @@ const Sidebar = ( { extraPanels, onActionPerformed } ) => {
tabName={ tabName }
keyboardShortcut={ keyboardShortcut }
showSummary={ showSummary }
renderingMode={ renderingMode }
onActionPerformed={ onActionPerformed }
extraPanels={ extraPanels }
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -40,6 +40,7 @@ export default function TemplateContentPanel( { renderingMode } ) {
? TEMPLATE_PART_BLOCK
: PAGE_CONTENT_BLOCKS
),
renderingMode: select( editorStore ).getRenderingMode(),
};
}, [] );

Expand Down

0 comments on commit f130e99

Please sign in to comment.