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

Backport Disable zoom out toggle button when Style Book is open to WP 6.7 #66233

Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion packages/editor/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function Header( {
// when the publish sidebar has been closed.
<PostSavedState forceIsDirty={ forceIsDirty } />
) }

<PreviewDropdown
forceIsAutosaveable={ forceIsDirty }
disabled={ isNestedEntity }
Expand All @@ -149,7 +150,9 @@ function Header( {
/>
<PostViewLink />

{ isEditorIframed && isWideViewport && <ZoomOutToggle /> }
{ isEditorIframed && isWideViewport && (
<ZoomOutToggle disabled={ forceDisableBlockTools } />
) }

{ ( isWideViewport || ! showIconLabels ) && (
<PinnedItems.Slot scope="core" />
Expand Down
4 changes: 3 additions & 1 deletion packages/editor/src/components/zoom-out-toggle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { store as preferencesStore } from '@wordpress/preferences';
*/
import { unlock } from '../../lock-unlock';

const ZoomOutToggle = () => {
const ZoomOutToggle = ( { disabled } ) => {
const { isZoomOut, showIconLabels } = useSelect( ( select ) => ( {
isZoomOut: unlock( select( blockEditorStore ) ).isZoomOut(),
showIconLabels: select( preferencesStore ).get(
Expand All @@ -38,6 +38,8 @@ const ZoomOutToggle = () => {

return (
<Button
accessibleWhenDisabled
disabled={ disabled }
onClick={ handleZoomOut }
icon={ zoomOutIcon }
label={ __( 'Toggle Zoom Out' ) }
Expand Down
Loading