Skip to content

Commit

Permalink
Site Editor: Restore quick inserter 'Browse all' button (#52529)
Browse files Browse the repository at this point in the history
* Site Editor: Restore quick inserter 'Browse all' button

* Remove leftover comment
  • Loading branch information
Mamaduka authored and ockham committed Jul 12, 2023
1 parent 66e2fff commit 6fe2c96
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 0 additions & 4 deletions packages/edit-site/src/components/block-editor/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/**
* External dependencies
*/

/**
* WordPress dependencies
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { useSelect } from '@wordpress/data';
import { useDispatch, useSelect } from '@wordpress/data';
import { useMemo } from '@wordpress/element';
import { store as coreStore } from '@wordpress/core-data';
/**
Expand All @@ -12,15 +12,19 @@ import { unlock } from '../../lock-unlock';
import inserterMediaCategories from './inserter-media-categories';

export default function useSiteEditorSettings( templateType ) {
const { storedSettings, canvasMode } = useSelect( ( select ) => {
const { getSettings, getCanvasMode } = unlock(
select( editSiteStore )
);
return {
storedSettings: getSettings(),
canvasMode: getCanvasMode(),
};
}, [] );
const { setIsInserterOpened } = useDispatch( editSiteStore );
const { storedSettings, canvasMode } = useSelect(
( select ) => {
const { getSettings, getCanvasMode } = unlock(
select( editSiteStore )
);
return {
storedSettings: getSettings( setIsInserterOpened ),
canvasMode: getCanvasMode(),
};
},
[ setIsInserterOpened ]
);

const settingsBlockPatterns =
storedSettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0
Expand Down

0 comments on commit 6fe2c96

Please sign in to comment.