Skip to content

Commit

Permalink
BlockSettingsMenu: Combine 'block-editor' store selectors (#59153)
Browse files Browse the repository at this point in the history
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: andrewserong <[email protected]>
  • Loading branch information
3 people authored Feb 19, 2024
1 parent b8d84db commit f088614
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export function BlockSettingsDropdown( {
parentBlockType,
previousBlockClientId,
selectedBlockClientIds,
openedBlockSettingsMenu,
} = useSelect(
( select ) => {
const {
Expand All @@ -107,7 +108,8 @@ export function BlockSettingsDropdown( {
getPreviousBlockClientId,
getSelectedBlockClientIds,
getBlockAttributes,
} = select( blockEditorStore );
getOpenedBlockSettingsMenu,
} = unlock( select( blockEditorStore ) );

const { getActiveBlockVariation } = select( blocksStore );

Expand All @@ -129,19 +131,14 @@ export function BlockSettingsDropdown( {
previousBlockClientId:
getPreviousBlockClientId( firstBlockClientId ),
selectedBlockClientIds: getSelectedBlockClientIds(),
openedBlockSettingsMenu: getOpenedBlockSettingsMenu(),
};
},
[ firstBlockClientId ]
);
const { getBlockOrder, getSelectedBlockClientIds } =
useSelect( blockEditorStore );

const openedBlockSettingsMenu = useSelect(
( select ) =>
unlock( select( blockEditorStore ) ).getOpenedBlockSettingsMenu(),
[]
);

const { setOpenedBlockSettingsMenu } = unlock(
useDispatch( blockEditorStore )
);
Expand Down

0 comments on commit f088614

Please sign in to comment.