Skip to content

Commit

Permalink
Conditionalise metaboxes based on Zoom Out (#66742)
Browse files Browse the repository at this point in the history
Co-authored-by: getdave <[email protected]>
Co-authored-by: kevin940726 <[email protected]>
Co-authored-by: MaggieCabrera <[email protected]>
Co-authored-by: t-hamano <[email protected]>
  • Loading branch information
5 people authored Nov 5, 2024
1 parent 02da42e commit 7a7fdd7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/edit-post/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@ function Layout( {
select( editPostStore )
);
const { canUser, getPostType } = select( coreStore );
const { __unstableGetEditorMode } = unlock(
select( blockEditorStore )
);

const supportsTemplateMode = settings.supportsTemplateMode;
const isViewable =
Expand All @@ -433,6 +436,8 @@ function Layout( {
name: 'wp_template',
} );

const isZoomOut = __unstableGetEditorMode() === 'zoom-out';

return {
mode: select( editorStore ).getEditorMode(),
isFullscreenActive:
Expand All @@ -444,7 +449,8 @@ function Layout( {
isDistractionFree: get( 'core', 'distractionFree' ),
showMetaBoxes:
! DESIGN_POST_TYPES.includes( currentPostType ) &&
select( editorStore ).getRenderingMode() === 'post-only',
select( editorStore ).getRenderingMode() === 'post-only' &&
! isZoomOut,
isWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),
templateId:
supportsTemplateMode &&
Expand Down

1 comment on commit 7a7fdd7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 7a7fdd7.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11683179354
📝 Reported issues:

Please sign in to comment.