Skip to content

Commit

Permalink
enter zoom out on category select
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu committed Mar 22, 2024
1 parent fe37fcf commit 09280c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import PatternsExplorerModal from '../block-patterns-explorer';
import MobileTabNavigation from '../mobile-tab-navigation';
import { PatternCategoryPreviews } from './pattern-category-previews';
import { usePatternCategories } from './use-pattern-categories';
import { useZoomOut } from '../../../hooks/use-zoom-out';

function BlockPatternsTab( {
onSelectCategory,
Expand All @@ -35,10 +34,6 @@ function BlockPatternsTab( {
const initialCategory = selectedCategory || categories[ 0 ];
const isMobile = useViewportMatch( 'medium', '<' );

// Move to zoom out mode when this component is mounted
// and back to the previous mode when unmounted.
useZoomOut();

return (
<>
{ ! isMobile && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
myPatternsCategory,
INSERTER_PATTERN_TYPES,
} from './utils';
import { useZoomOut } from '../../../hooks/use-zoom-out';

const noop = () => {};

Expand All @@ -49,6 +50,10 @@ export function PatternCategoryPreviews( {
const [ patternSyncFilter, setPatternSyncFilter ] = useState( 'all' );
const [ patternSourceFilter, setPatternSourceFilter ] = useState( 'all' );

// Move to zoom out mode when this component is mounted
// and back to the previous mode when unmounted.
useZoomOut();

const availableCategories = usePatternCategories(
rootClientId,
patternSourceFilter
Expand Down

0 comments on commit 09280c1

Please sign in to comment.