From b0e96c49d0abd6deb8f8caf726b6575f6e355681 Mon Sep 17 00:00:00 2001
From: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
Date: Thu, 9 Mar 2023 15:14:13 +0900
Subject: [PATCH] Distraction Free Mode: Don't show the metaboxes (#48947)
---
packages/edit-post/src/components/layout/index.js | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js
index 3fe02dbe5004f9..15bc017900daa2 100644
--- a/packages/edit-post/src/components/layout/index.js
+++ b/packages/edit-post/src/components/layout/index.js
@@ -83,7 +83,7 @@ function Layout( { styles } ) {
isInserterOpened,
isListViewOpened,
showIconLabels,
- isDistractionFreeMode,
+ isDistractionFree,
showBlockBreadcrumbs,
isTemplateMode,
documentLabel,
@@ -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'
@@ -126,8 +126,6 @@ function Layout( { styles } ) {
};
}, [] );
- const isDistractionFree = isDistractionFreeMode && isLargeViewport;
-
const openSidebarPanel = () =>
openGeneralSidebar(
hasBlockSelected ? 'edit-post/block' : 'edit-post/document'
@@ -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,
} );
@@ -206,7 +204,7 @@ function Layout( { styles } ) {