From 9310ed948967082886c8fcb948c4d7a55943e7e9 Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Thu, 8 Feb 2024 13:59:05 -0500 Subject: [PATCH] Try disabling 50% when its not possible --- .../src/components/preview-dropdown/index.js | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/packages/editor/src/components/preview-dropdown/index.js b/packages/editor/src/components/preview-dropdown/index.js index e066afe1782de9..961936d4b15420 100644 --- a/packages/editor/src/components/preview-dropdown/index.js +++ b/packages/editor/src/components/preview-dropdown/index.js @@ -10,14 +10,7 @@ import { Icon, } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; -import { - check, - desktop, - mobile, - tablet, - external, - chevronUpDown, -} from '@wordpress/icons'; +import { check, desktop, mobile, tablet, external } from '@wordpress/icons'; import { useSelect, useDispatch } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; import { store as preferencesStore } from '@wordpress/preferences'; @@ -86,11 +79,7 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) { popoverProps={ popoverProps } toggleProps={ toggleProps } menuProps={ menuProps } - icon={ - isZoomedOutView - ? chevronUpDown - : deviceIcons[ deviceType.toLowerCase() ] - } + icon={ deviceIcons[ deviceType.toLowerCase() ] } label={ __( 'View' ) } disableOpenOnArrowDown={ disabled } > @@ -129,7 +118,6 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) { { - setDeviceType( 'Desktop' ); __unstableSetEditorMode( 'edit' ); } } icon={ ! isZoomedOutView && check } @@ -142,6 +130,7 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) { __unstableSetEditorMode( 'zoom-out' ); } } icon={ isZoomedOutView && check } + disabled={ deviceType !== 'Desktop' } > { __( 'Zoom to 50%' ) }