From afb6752c59dbfb35b04739df503a14a37c0fe365 Mon Sep 17 00:00:00 2001 From: Mayank Tripathi <70465598+Mayank-Tripathi32@users.noreply.github.com> Date: Fri, 13 Dec 2024 20:23:39 +0530 Subject: [PATCH] Refactor "Settings" panel of Social Icon block to use ToolsPanel instead of PanelBody (#67974) Co-authored-by: Mayank-Tripathi32 Co-authored-by: fabiankaegy --- .../block-library/src/social-link/edit.js | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/packages/block-library/src/social-link/edit.js b/packages/block-library/src/social-link/edit.js index 91f1e4170b33dd..43fb305d52ffaf 100644 --- a/packages/block-library/src/social-link/edit.js +++ b/packages/block-library/src/social-link/edit.js @@ -22,10 +22,10 @@ import { useState, useRef } from '@wordpress/element'; import { Button, Dropdown, - PanelBody, - PanelRow, TextControl, ToolbarButton, + __experimentalToolsPanel as ToolsPanel, + __experimentalToolsPanelItem as ToolsPanelItem, __experimentalInputControlSuffixWrapper as InputControlSuffixWrapper, } from '@wordpress/components'; import { useMergeRefs } from '@wordpress/compose'; @@ -195,8 +195,20 @@ const SocialLinkEdit = ( { ) } - - + { + setAttributes( { label: undefined } ); + } } + > + !! label } + onDeselect={ () => { + setAttributes( { label: undefined } ); + } } + > - - + +