Skip to content

Commit

Permalink
Logic and display tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
richtabor committed Jan 24, 2024
1 parent 54e7cb5 commit e6bc6cf
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/editor/src/components/preview-dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,22 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
popoverProps={ popoverProps }
toggleProps={ toggleProps }
menuProps={ menuProps }
icon={ deviceIcons[ deviceType.toLowerCase() ] }
icon={
isZoomedOutView
? chevronUpDown
: deviceIcons[ deviceType.toLowerCase() ]
}
label={ __( 'View' ) }
disableOpenOnArrowDown={ disabled }
>
{ ( { onClose } ) => (
<>
<MenuGroup>
<MenuItem
onClick={ () => setDeviceType( 'Desktop' ) }
onClick={ () => {
setDeviceType( 'Desktop' );
__unstableSetEditorMode( 'edit' );
} }
icon={
deviceType === 'Desktop' &&
! isZoomedOutView &&
Expand Down Expand Up @@ -131,9 +138,9 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
isZoomedOutView ? 'edit' : 'zoom-out'
);
} }
icon={ isZoomedOutView ? check : chevronUpDown }
icon={ isZoomedOutView && check }
>
{ __( 'Zoom out' ) }
{ __( 'Zoom to 50%' ) }
</MenuItem>
</MenuGroup>
) }
Expand Down

0 comments on commit e6bc6cf

Please sign in to comment.