Skip to content

Commit

Permalink
Distraction Free Mode: Don't show the metaboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Mar 9, 2023
1 parent 3f1eff9 commit 4ac5156
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 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 @@ -245,14 +243,16 @@ function Layout( { styles } ) {
notices={ <EditorSnackbars /> }
content={
<>
{ ! isDistractionFree && <EditorNotices /> }
{ ( ! isDistractionFree || ! isLargeViewport ) && (
<EditorNotices />
) }
{ ( mode === 'text' || ! isRichEditingEnabled ) && (
<TextEditor />
) }
{ 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 +265,8 @@ function Layout( { styles } ) {
}
footer={
! isDistractionFree &&
showBlockBreadcrumbs &&
! isMobileViewport &&
showBlockBreadcrumbs &&
isRichEditingEnabled &&
mode === 'visual' && (
<div className="edit-post-layout__footer">
Expand Down

0 comments on commit 4ac5156

Please sign in to comment.