Skip to content

Commit

Permalink
fix: use dropdown menu props social links block
Browse files Browse the repository at this point in the history
  • Loading branch information
im3dabasia committed Dec 16, 2024
1 parent 120888b commit ef3acba
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/block-library/src/social-links/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ import { __ } from '@wordpress/i18n';
import { check } from '@wordpress/icons';
import { useSelect } from '@wordpress/data';

/**
* Internal dependencies
*/
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';

const sizeOptions = [
{ name: __( 'Small' ), value: 'has-small-icon-size' },
{ name: __( 'Normal' ), value: 'has-normal-icon-size' },
Expand Down Expand Up @@ -69,6 +74,8 @@ export function SocialLinksEdit( props ) {

const logosOnly = attributes.className?.includes( 'is-style-logos-only' );

const dropdownMenuProps = useToolsPanelDropdownMenuProps();

// Remove icon background color when logos only style is selected or
// restore it when any other style is selected.
const backgroundBackupRef = useRef( {} );
Expand Down Expand Up @@ -207,6 +214,7 @@ export function SocialLinksEdit( props ) {
showLabels: false,
} );
} }
dropdownMenuProps={ dropdownMenuProps }
>
<ToolsPanelItem
isShownByDefault
Expand Down

0 comments on commit ef3acba

Please sign in to comment.