From 7b48e383bf0584a8f457564d36270312f140d132 Mon Sep 17 00:00:00 2001 From: Rich Tabor Date: Wed, 26 Jul 2023 16:52:02 -0400 Subject: [PATCH] Try using text instead of icon for ToolbarButton --- packages/block-library/src/block/edit.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/block-library/src/block/edit.js b/packages/block-library/src/block/edit.js index 0b1f3b01b75b9..a917ddff87688 100644 --- a/packages/block-library/src/block/edit.js +++ b/packages/block-library/src/block/edit.js @@ -28,7 +28,6 @@ import { store as blockEditorStore, } from '@wordpress/block-editor'; import { store as reusableBlocksStore } from '@wordpress/reusable-blocks'; -import { ungroup } from '@wordpress/icons'; export default function ReusableBlockEdit( { attributes: { ref }, clientId } ) { const hasAlreadyRendered = useHasRecursion( ref ); @@ -39,13 +38,11 @@ export default function ReusableBlockEdit( { attributes: { ref }, clientId } ) { ); const isMissing = hasResolved && ! record; - const { canRemove, innerBlockCount } = useSelect( + const { canRemove } = useSelect( ( select ) => { - const { canRemoveBlock, getBlockCount } = - select( blockEditorStore ); + const { canRemoveBlock } = select( blockEditorStore ); return { canRemove: canRemoveBlock( clientId ), - innerBlockCount: getBlockCount( clientId ), }; }, [ clientId ] @@ -117,14 +114,11 @@ export default function ReusableBlockEdit( { attributes: { ref }, clientId } ) { convertBlockToStatic( clientId ) } - label={ - innerBlockCount > 1 - ? __( 'Detach patterns' ) - : __( 'Detach pattern' ) - } - icon={ ungroup } + label={ __( 'Detach' ) } showTooltip - /> + > + { __( 'Detach' ) } + ) }