Skip to content

Commit

Permalink
Try disabling 50% when its not possible
Browse files Browse the repository at this point in the history
  • Loading branch information
richtabor authored and getdave committed Feb 21, 2024
1 parent a0286b7 commit 9310ed9
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions packages/editor/src/components/preview-dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 }
>
Expand Down Expand Up @@ -129,7 +118,6 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
<MenuGroup>
<MenuItem
onClick={ () => {
setDeviceType( 'Desktop' );
__unstableSetEditorMode( 'edit' );
} }
icon={ ! isZoomedOutView && check }
Expand All @@ -142,6 +130,7 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
__unstableSetEditorMode( 'zoom-out' );
} }
icon={ isZoomedOutView && check }
disabled={ deviceType !== 'Desktop' }
>
{ __( 'Zoom to 50%' ) }
</MenuItem>
Expand Down

0 comments on commit 9310ed9

Please sign in to comment.