Skip to content

Commit

Permalink
also consolidate selectors for header mode
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Jul 5, 2023
1 parent 43df099 commit cb7fb40
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/edit-site/src/components/header-edit-mode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export default function HeaderEditMode() {
homeUrl,
showIconLabels,
editorCanvasView,
hasFixedToolbar,
} = useSelect( ( select ) => {
const {
__experimentalGetPreviewDeviceType,
Expand All @@ -83,6 +84,8 @@ export default function HeaderEditMode() {
getUnstableBase, // Site index.
} = select( coreStore );

const { get: getPreference } = select( preferencesStore );

return {
deviceType: __experimentalGetPreviewDeviceType(),
templateType: postType,
Expand All @@ -105,12 +108,13 @@ export default function HeaderEditMode() {
'core/edit-site',
'distractionFree'
),
hasFixedToolbar: getPreference(
editSiteStore.name,
'fixedToolbar'
),
};
}, [] );

const { get: getPreference } = useSelect( preferencesStore );
const hasFixedToolbar = getPreference( editSiteStore.name, 'fixedToolbar' );

const {
__experimentalSetPreviewDeviceType: setPreviewDeviceType,
setIsInserterOpened,
Expand Down

0 comments on commit cb7fb40

Please sign in to comment.