Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Header: remove unused property isZoomedOutView in useSelect() #65628

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions packages/editor/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { __unstableMotion as motion } from '@wordpress/components';
import { store as preferencesStore } from '@wordpress/preferences';
import { useState } from '@wordpress/element';
import { PinnedItems } from '@wordpress/interface';
import { store as blockEditorStore } from '@wordpress/block-editor';

/**
* Internal dependencies
Expand Down Expand Up @@ -65,7 +64,6 @@ function Header( {
getEditorSettings,
isPublishSidebarOpened: _isPublishSidebarOpened,
} = select( editorStore );
const { __unstableGetEditorMode } = select( blockEditorStore );

return {
isTextEditor: getEditorMode() === 'text',
Expand All @@ -74,7 +72,6 @@ function Header( {
hasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),
isNestedEntity:
!! getEditorSettings().onNavigateToPreviousEntityRecord,
isZoomedOutView: __unstableGetEditorMode() === 'zoom-out',
};
}, [] );

Expand All @@ -83,9 +80,10 @@ function Header( {

const hasCenter = isBlockToolsCollapsed && ! isTooNarrowForDocumentBar;
const hasBackButton = useHasBackButton();

// The edit-post-header classname is only kept for backward compatibilty
// as some plugins might be relying on its presence.
/*
* The edit-post-header classname is only kept for backward compatability
* as some plugins might be relying on its presence.
*/
return (
<div className="editor-header edit-post-header">
{ hasBackButton && (
Expand Down Expand Up @@ -127,11 +125,13 @@ function Header( {
className="editor-header__settings"
>
{ ! customSaveButton && ! isPublishSidebarOpened && (
// This button isn't completely hidden by the publish sidebar.
// We can't hide the whole toolbar when the publish sidebar is open because
// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
// We track that DOM node to return focus to the PostPublishButtonOrToggle
// when the publish sidebar has been closed.
/*
* This button isn't completely hidden by the publish sidebar.
* We can't hide the whole toolbar when the publish sidebar is open because
* we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
* We track that DOM node to return focus to the PostPublishButtonOrToggle
* when the publish sidebar has been closed.
*/
<PostSavedState forceIsDirty={ forceIsDirty } />
) }
<PreviewDropdown
Expand Down
Loading