Skip to content

Commit

Permalink
feat: Removes the size control from block controls.
Browse files Browse the repository at this point in the history
  • Loading branch information
vipul0425 committed Sep 30, 2024
1 parent 7e7b9e4 commit 793521f
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions packages/block-library/src/social-links/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import clsx from 'clsx';
*/
import { useEffect, useRef } from '@wordpress/element';
import {
BlockControls,
useInnerBlocksProps,
useBlockProps,
InspectorControls,
Expand All @@ -20,16 +19,12 @@ import {
store as blockEditorStore,
} from '@wordpress/block-editor';
import {
MenuGroup,
MenuItem,
PanelBody,
ToggleControl,
ToolbarDropdownMenu,
__experimentalToggleGroupControl as ToggleGroupControl,
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { check } from '@wordpress/icons';
import { useSelect } from '@wordpress/data';

const sizeOptions = [
Expand Down Expand Up @@ -119,10 +114,6 @@ export function SocialLinksEdit( props ) {
renderAppender: hasAnySelected && InnerBlocks.ButtonBlockAppender,
} );

const POPOVER_PROPS = {
position: 'bottom right',
};

const colorSettings = [
{
// Use custom attribute as fallback to prevent loss of named color selection when
Expand Down Expand Up @@ -163,43 +154,6 @@ export function SocialLinksEdit( props ) {

return (
<>
<BlockControls group="other">
<ToolbarDropdownMenu
label={ __( 'Size' ) }
text={ __( 'Size' ) }
icon={ null }
popoverProps={ POPOVER_PROPS }
>
{ ( { onClose } ) => (
<MenuGroup>
{ sizeOptions.map( ( entry ) => {
return (
<MenuItem
icon={
( size === entry.value ||
( ! size &&
entry.value ===
'has-normal-icon-size' ) ) &&
check
}
isSelected={ size === entry.value }
key={ entry.value }
onClick={ () => {
setAttributes( {
size: entry.value,
} );
} }
onClose={ onClose }
role="menuitemradio"
>
{ entry.name }
</MenuItem>
);
} ) }
</MenuGroup>
) }
</ToolbarDropdownMenu>
</BlockControls>
<InspectorControls>
<PanelBody title={ __( 'Settings' ) }>
<ToggleGroupControl
Expand Down

0 comments on commit 793521f

Please sign in to comment.