From e8613cfa10b94f872d095efad91c47ad92571ddc Mon Sep 17 00:00:00 2001 From: Grant Kinney Date: Fri, 12 Mar 2021 11:06:17 -0600 Subject: [PATCH] Site Editor: Always use full screen mode (#29489) Removes the option to toggle fullscreen mode in the Site Editor. From now on it will always be on, similar to Customizer. --- .../edit-site/src/components/editor/index.js | 5 +-- .../src/components/header/more-menu/index.js | 9 ----- .../src/components/header/style.scss | 13 +++---- .../navigation-toggle/index.js | 37 +++++++------------ .../navigation-toggle/style.scss | 10 +---- packages/edit-site/src/store/defaults.js | 4 +- 6 files changed, 22 insertions(+), 56 deletions(-) diff --git a/packages/edit-site/src/components/editor/index.js b/packages/edit-site/src/components/editor/index.js index 9b5d8a0962d4c..eff877009255f 100644 --- a/packages/edit-site/src/components/editor/index.js +++ b/packages/edit-site/src/components/editor/index.js @@ -43,7 +43,6 @@ const interfaceLabels = { function Editor( { initialSettings } ) { const { - isFullscreenActive, isInserterOpen, isListViewOpen, sidebarIsOpened, @@ -55,7 +54,6 @@ function Editor( { initialSettings } ) { isNavigationOpen, } = useSelect( ( select ) => { const { - isFeatureActive, isInserterOpened, isListViewOpened, getSettings, @@ -75,7 +73,6 @@ function Editor( { initialSettings } ) { return { isInserterOpen: isInserterOpened(), isListViewOpen: isListViewOpened(), - isFullscreenActive: isFeatureActive( 'fullscreenMode' ), sidebarIsOpened: !! select( interfaceStore ).getActiveComplementaryArea( editSiteStore.name ), @@ -169,7 +166,7 @@ function Editor( { initialSettings } ) { return ( <> - + diff --git a/packages/edit-site/src/components/header/more-menu/index.js b/packages/edit-site/src/components/header/more-menu/index.js index 7a2d6b4bbcc30..b06193fd853ae 100644 --- a/packages/edit-site/src/components/header/more-menu/index.js +++ b/packages/edit-site/src/components/header/more-menu/index.js @@ -49,15 +49,6 @@ const MoreMenu = () => ( 'Spotlight mode deactivated' ) } /> - { - const { isFeatureActive } = select( editSiteStore ); - const { getEntityRecord } = select( 'core' ); - const { isResolving } = select( 'core/data' ); - const siteData = - getEntityRecord( 'root', '__unstableBase', undefined ) || {}; + const { isRequestingSiteIcon, siteIconUrl } = useSelect( ( select ) => { + const { getEntityRecord } = select( 'core' ); + const { isResolving } = select( 'core/data' ); + const siteData = + getEntityRecord( 'root', '__unstableBase', undefined ) || {}; - return { - isActive: isFeatureActive( 'fullscreenMode' ), - isRequestingSiteIcon: isResolving( 'core', 'getEntityRecord', [ - 'root', - '__unstableBase', - undefined, - ] ), - siteIconUrl: siteData.site_icon_url, - }; - }, - [] - ); + return { + isRequestingSiteIcon: isResolving( 'core', 'getEntityRecord', [ + 'root', + '__unstableBase', + undefined, + ] ), + siteIconUrl: siteData.site_icon_url, + }; + }, [] ); const { setIsNavigationPanelOpened } = useDispatch( editSiteStore ); - if ( ! isActive ) { - return null; - } - let buttonIcon = ; if ( siteIconUrl ) { diff --git a/packages/edit-site/src/components/navigation-sidebar/navigation-toggle/style.scss b/packages/edit-site/src/components/navigation-sidebar/navigation-toggle/style.scss index 42cf75b029ab2..c628dae3dd884 100644 --- a/packages/edit-site/src/components/navigation-sidebar/navigation-toggle/style.scss +++ b/packages/edit-site/src/components/navigation-sidebar/navigation-toggle/style.scss @@ -2,19 +2,11 @@ align-items: center; background: $gray-900; border-radius: 0; - display: none; + display: flex; position: absolute; z-index: z-index(".edit-site-navigation-toggle"); height: $header-height; width: $header-height; - - @include break-medium() { - display: flex; - } - - body.is-navigation-sidebar-open & { - display: flex; - } } .edit-site-navigation-toggle__button { diff --git a/packages/edit-site/src/store/defaults.js b/packages/edit-site/src/store/defaults.js index b7f95f64d6cfb..d3a1116465d97 100644 --- a/packages/edit-site/src/store/defaults.js +++ b/packages/edit-site/src/store/defaults.js @@ -1,5 +1,3 @@ export const PREFERENCES_DEFAULTS = { - features: { - fullscreenMode: true, - }, + features: {}, };