Skip to content

Commit

Permalink
Distraction Free Mode: Don't show the metaboxes (#48947)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano authored Mar 9, 2023
1 parent 564b6d5 commit b0e96c4
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/edit-post/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function Layout( { styles } ) {
isInserterOpened,
isListViewOpened,
showIconLabels,
isDistractionFreeMode,
isDistractionFree,
showBlockBreadcrumbs,
isTemplateMode,
documentLabel,
Expand Down Expand Up @@ -116,7 +116,7 @@ function Layout( { styles } ) {
).getAllShortcutKeyCombinations( 'core/edit-post/next-region' ),
showIconLabels:
select( editPostStore ).isFeatureActive( 'showIconLabels' ),
isDistractionFreeMode:
isDistractionFree:
select( editPostStore ).isFeatureActive( 'distractionFree' ),
showBlockBreadcrumbs: select( editPostStore ).isFeatureActive(
'showBlockBreadcrumbs'
Expand All @@ -126,8 +126,6 @@ function Layout( { styles } ) {
};
}, [] );

const isDistractionFree = isDistractionFreeMode && isLargeViewport;

const openSidebarPanel = () =>
openGeneralSidebar(
hasBlockSelected ? 'edit-post/block' : 'edit-post/document'
Expand Down Expand Up @@ -164,7 +162,7 @@ function Layout( { styles } ) {
'has-fixed-toolbar': hasFixedToolbar,
'has-metaboxes': hasActiveMetaboxes,
'show-icon-labels': showIconLabels,
'is-distraction-free': isDistractionFree,
'is-distraction-free': isDistractionFree && isLargeViewport,
'is-entity-save-view-open': !! entitiesSavedStatesCallback,
} );

Expand Down Expand Up @@ -206,7 +204,7 @@ function Layout( { styles } ) {
<EditorKeyboardShortcutsRegister />
<SettingsSidebar />
<InterfaceSkeleton
isDistractionFree={ isDistractionFree }
isDistractionFree={ isDistractionFree && isLargeViewport }
className={ className }
labels={ {
...interfaceLabels,
Expand Down Expand Up @@ -252,7 +250,7 @@ function Layout( { styles } ) {
{ isRichEditingEnabled && mode === 'visual' && (
<VisualEditor styles={ styles } />
) }
{ ! isTemplateMode && (
{ ! isDistractionFree && ! isTemplateMode && (
<div className="edit-post-layout__metaboxes">
<MetaBoxes location="normal" />
<MetaBoxes location="advanced" />
Expand All @@ -265,8 +263,8 @@ function Layout( { styles } ) {
}
footer={
! isDistractionFree &&
showBlockBreadcrumbs &&
! isMobileViewport &&
showBlockBreadcrumbs &&
isRichEditingEnabled &&
mode === 'visual' && (
<div className="edit-post-layout__footer">
Expand Down

1 comment on commit b0e96c4

@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 b0e96c4.
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/4371645442
📝 Reported issues:

Please sign in to comment.