diff --git a/packages/edit-post/src/components/header/index.js b/packages/edit-post/src/components/header/index.js index 3306a0fdf1606..27fff18be8d6f 100644 --- a/packages/edit-post/src/components/header/index.js +++ b/packages/edit-post/src/components/header/index.js @@ -27,7 +27,6 @@ function Header( { setEntitiesSavedStatesCallback } ) { isPublishSidebarOpened, isSaving, showIconLabels, - isDistractionFreeMode, } = useSelect( ( select ) => ( { hasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(), @@ -36,21 +35,17 @@ function Header( { setEntitiesSavedStatesCallback } ) { isSaving: select( editPostStore ).isSavingMetaBoxes(), showIconLabels: select( editPostStore ).isFeatureActive( 'showIconLabels' ), - isDistractionFreeMode: - select( editPostStore ).isFeatureActive( 'distractionFree' ), } ), [] ); - const isDistractionFree = isDistractionFreeMode && isLargeViewport; - const slideY = { - hidden: isDistractionFree ? { y: '-50' } : { y: 0 }, + hidden: { y: '-50px' }, hover: { y: 0, transition: { type: 'tween', delay: 0.2 } }, }; const slideX = { - hidden: isDistractionFree ? { x: '-100%' } : { x: 0 }, + hidden: { x: '-100%' }, hover: { x: 0, transition: { type: 'tween', delay: 0.2 } }, }; diff --git a/packages/edit-post/src/components/header/writing-menu/index.js b/packages/edit-post/src/components/header/writing-menu/index.js index 6cea56392381e..c0d6ff994815e 100644 --- a/packages/edit-post/src/components/header/writing-menu/index.js +++ b/packages/edit-post/src/components/header/writing-menu/index.js @@ -25,26 +25,16 @@ function WritingMenu() { [] ); - const blocks = useSelect( - ( select ) => select( blockEditorStore ).getBlocks(), - [] - ); - const { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } = useDispatch( postEditorStore ); const { set: setPreference } = useDispatch( preferencesStore ); - const { selectBlock } = useDispatch( blockEditorStore ); - const toggleDistractionFree = () => { registry.batch( () => { setPreference( 'core/edit-post', 'fixedToolbar', false ); setIsInserterOpened( false ); setIsListViewOpened( false ); closeGeneralSidebar(); - if ( ! isDistractionFree && !! blocks.length ) { - selectBlock( blocks[ 0 ].clientId ); - } } ); }; diff --git a/packages/interface/src/components/interface-skeleton/index.js b/packages/interface/src/components/interface-skeleton/index.js index fe329a75d43e0..43e4e532e8eab 100644 --- a/packages/interface/src/components/interface-skeleton/index.js +++ b/packages/interface/src/components/interface-skeleton/index.js @@ -75,11 +75,12 @@ function InterfaceSkeleton( const mergedLabels = { ...defaultLabels, ...labels }; const headerVariants = { - hidden: isDistractionFree ? { opacity: 0 } : { opacity: 1 }, + hidden: { opacity: 0 }, hover: { opacity: 1, transition: { type: 'tween', delay: 0.2, delayChildren: 0.2 }, }, + distractionFreeInactive: { opacity: 1, transition: { delay: 0 } }, }; return ( @@ -97,23 +98,32 @@ function InterfaceSkeleton( ) } >
- { !! header && isDistractionFree && ( + { !! header && ( - { header } - - ) } - { !! header && ! isDistractionFree && ( - { header }