Skip to content

Commit

Permalink
BlockSettingsMenu: Combine 'block-editor' store selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Feb 18, 2024
1 parent 697856b commit a84f6d1
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 a84f6d1

Please sign in to comment.