Skip to content

Commit

Permalink
Template Parts: Hide 'Detach blocks' when locked (#40000)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Apr 4, 2022
1 parent 86ed6c5 commit dde2f52
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ export default function ConvertToRegularBlocks( { clientId } ) {
const { getBlocks } = useSelect( blockEditorStore );
const { replaceBlocks } = useDispatch( blockEditorStore );

const canRemove = useSelect(
( select ) => select( blockEditorStore ).canRemoveBlock( clientId ),
[ clientId ]
);

if ( ! canRemove ) {
return null;
}

return (
<BlockSettingsMenuControls>
{ ( { onClose } ) => (
Expand Down

0 comments on commit dde2f52

Please sign in to comment.