diff --git a/packages/block-editor/src/hooks/style.js b/packages/block-editor/src/hooks/style.js index 382f62288fd6f..e856f8e91bd82 100644 --- a/packages/block-editor/src/hooks/style.js +++ b/packages/block-editor/src/hooks/style.js @@ -22,6 +22,7 @@ import { COLOR_SUPPORT_KEY, ColorEdit } from './color'; import { FONT_SIZE_SUPPORT_KEY } from './font-size'; import { TypographyPanel, TYPOGRAPHY_SUPPORT_KEYS } from './typography'; import { SPACING_SUPPORT_KEY, SpacingPanel } from './spacing'; +import useDisplayBlockControls from '../components/use-display-block-controls'; const styleSupportKeys = [ ...TYPOGRAPHY_SUPPORT_KEYS, @@ -182,13 +183,21 @@ export function addEditProps( settings ) { */ export const withBlockControls = createHigherOrderComponent( ( BlockEdit ) => ( props ) => { - return [ - , - , - , - , - , - ]; + const shouldDisplayControls = useDisplayBlockControls(); + + return ( + <> + { shouldDisplayControls && ( + <> + + + + + + ) } + + + ); }, 'withToolbarControls' );