File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/block-editor/src/components/grid-visualizer Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 22 * WordPress dependencies
33 */
44import { useState , useEffect } from '@wordpress/element' ;
5+ import { useSelect } from '@wordpress/data' ;
56
67/**
78 * Internal dependencies
89 */
910import { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs' ;
1011import BlockPopoverCover from '../block-popover/cover' ;
12+ import { store as blockEditorStore } from '../../store' ;
1113import { getComputedCSS } from './utils' ;
1214
1315export function GridVisualizer ( { clientId } ) {
16+ const isDistractionFree = useSelect (
17+ ( select ) =>
18+ select ( blockEditorStore ) . getSettings ( ) . isDistractionFree ,
19+ [ ]
20+ ) ;
1421 const blockElement = useBlockElement ( clientId ) ;
15- if ( ! blockElement ) {
22+
23+ if ( isDistractionFree || ! blockElement ) {
1624 return null ;
1725 }
26+
1827 return (
1928 < BlockPopoverCover
2029 className = "block-editor-grid-visualizer"
You can’t perform that action at this time.
0 commit comments