Skip to content

Commit

Permalink
Block Editor: Deprecate 'BlockColorsStyleSelector' component (#40502)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Apr 21, 2022
1 parent 5bfef64 commit 0680124
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions packages/block-editor/src/components/color-style-selector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { DOWN } from '@wordpress/keycodes';
import deprecated from '@wordpress/deprecated';

const ColorSelectorSVGIcon = () => (
<SVG xmlns="https://www.w3.org/2000/svg" viewBox="0 0 20 20">
Expand Down Expand Up @@ -78,14 +79,22 @@ const renderToggleComponent = ( { TextColor, BackgroundColor } ) => ( {
);
};

const BlockColorsStyleSelector = ( { children, ...other } ) => (
<Dropdown
position="bottom right"
className="block-library-colors-selector"
contentClassName="block-library-colors-selector__popover"
renderToggle={ renderToggleComponent( other ) }
renderContent={ () => children }
/>
);
const BlockColorsStyleSelector = ( { children, ...other } ) => {
deprecated( `wp.blockEditor.BlockColorsStyleSelector`, {
alternative: 'block supports API',
since: '6.1',
version: '6.3',
} );

return (
<Dropdown
position="bottom right"
className="block-library-colors-selector"
contentClassName="block-library-colors-selector__popover"
renderToggle={ renderToggleComponent( other ) }
renderContent={ () => children }
/>
);
};

export default BlockColorsStyleSelector;

0 comments on commit 0680124

Please sign in to comment.