Skip to content

Commit

Permalink
Zoom Out: Disable zoom out toggle button when Style Book is open (#66228
Browse files Browse the repository at this point in the history
)

Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: madhusudhand <madhudollu@git.wordpress.org>
Co-authored-by: getdave <get_dave@git.wordpress.org>
Co-authored-by: colorful-tones <colorful-tones@git.wordpress.org>
  • Loading branch information
5 people authored Oct 18, 2024
1 parent d330f30 commit 388dd81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/editor/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function Header( {
) }

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

<PreviewDropdown
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 @@ -37,6 +37,8 @@ const ZoomOutToggle = () => {

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

0 comments on commit 388dd81

Please sign in to comment.