Skip to content

Commit

Permalink
Remove media query simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Aug 17, 2021
1 parent b65a2ac commit 9887ee0
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions packages/block-editor/src/components/use-resize-canvas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,14 @@
*/
import { useEffect, useState } from '@wordpress/element';

/**
* Internal dependencies
*/
import { default as useSimulatedMediaQuery } from '../../components/use-simulated-media-query';

/**
* Function to resize the editor window.
*
* @param {string} deviceType Used for determining the size of the container (e.g. Desktop, Tablet, Mobile)
* @param {boolean} __unstableDisableSimulation Whether to disable media query simulation.
* @param {string} deviceType Used for determining the size of the container (e.g. Desktop, Tablet, Mobile)
*
* @return {Object} Inline styles to be added to resizable container.
*/
export default function useResizeCanvas(
deviceType,
__unstableDisableSimulation
) {
export default function useResizeCanvas( deviceType ) {
const [ actualWidth, updateActualWidth ] = useState( window.innerWidth );

useEffect( () => {
Expand Down Expand Up @@ -72,11 +63,5 @@ export default function useResizeCanvas(
}
};

const width = __unstableDisableSimulation
? null
: getCanvasWidth( deviceType );

useSimulatedMediaQuery( 'resizable-editor-section', width );

return contentInlineStyles( deviceType );
}

0 comments on commit 9887ee0

Please sign in to comment.