Skip to content

Commit

Permalink
adds the experimental zoom out back
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed May 21, 2024
1 parent f1bca98 commit d2039da
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ import {
myPatternsCategory,
INSERTER_PATTERN_TYPES,
} from './utils';
import { useZoomOut } from '../../../hooks/use-zoom-out';

const noop = () => {};

export function PatternCategoryPreviews( {
function PatternCategoryPreviewsContent( {
rootClientId,
onInsert,
onHover = noop,
Expand Down Expand Up @@ -186,3 +187,17 @@ export function PatternCategoryPreviews( {
</>
);
}

function PatternCategoryPreviewsContentWithZoomOut( props ) {
useZoomOut();
return <PatternCategoryPreviewsContent { ...props } />;
}

export function PatternCategoryPreviews( props ) {
// When the pattern panel is showing, we want to use zoom out mode
if ( window.__experimentalEnableZoomedOutPatternsTab ) {
return <PatternCategoryPreviewsContentWithZoomOut { ...props } />;
}

return <PatternCategoryPreviewsContent { ...props } />;
}

0 comments on commit d2039da

Please sign in to comment.