From e6bc6cfad57f26aa00c4bde3fd0006fcd021ece8 Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Wed, 24 Jan 2024 10:22:57 -0500 Subject: [PATCH] Logic and display tweak --- .../src/components/preview-dropdown/index.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/editor/src/components/preview-dropdown/index.js b/packages/editor/src/components/preview-dropdown/index.js index aa04122482707d..529960b47477cc 100644 --- a/packages/editor/src/components/preview-dropdown/index.js +++ b/packages/editor/src/components/preview-dropdown/index.js @@ -86,7 +86,11 @@ 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 } > @@ -94,7 +98,10 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) { <> setDeviceType( 'Desktop' ) } + onClick={ () => { + setDeviceType( 'Desktop' ); + __unstableSetEditorMode( 'edit' ); + } } icon={ deviceType === 'Desktop' && ! isZoomedOutView && @@ -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%' ) } ) }