Skip to content

Commit

Permalink
Always preview style variations using desktop device type (#66023)
Browse files Browse the repository at this point in the history
* always preview style variations using desktop device type

* Improve comment

---------

Co-authored-by: draganescu <andraganescu@git.wordpress.org>
Co-authored-by: getdave <get_dave@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: richtabor <richtabor@git.wordpress.org>
Co-authored-by: juanfra <juanfra@git.wordpress.org>
  • Loading branch information
6 people authored Oct 11, 2024
1 parent b6c321f commit 4f3da91
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import { Card, CardBody } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { useZoomOut } from '@wordpress/block-editor';
import { useDispatch } from '@wordpress/data';
import { store as editorStore } from '@wordpress/editor';

/**
* Internal dependencies
Expand All @@ -12,9 +14,12 @@ import ScreenHeader from './header';
import SidebarNavigationScreenGlobalStylesContent from '../sidebar-navigation-screen-global-styles/content';

function ScreenStyleVariations() {
// Move to zoom out mode when this component is mounted
// and back to the previous mode when unmounted.
// Style Variations should only be previewed in with
// - a "zoomed out" editor
// - "Desktop" device preview
const { setDeviceType } = useDispatch( editorStore );
useZoomOut();
setDeviceType( 'desktop' );

return (
<>
Expand Down

0 comments on commit 4f3da91

Please sign in to comment.