Skip to content

Commit

Permalink
Try using text instead of icon for ToolbarButton
Browse files Browse the repository at this point in the history
  • Loading branch information
richtabor committed Jul 26, 2023
1 parent 7eddee3 commit 7b48e38
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions packages/block-library/src/block/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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 ]
Expand Down Expand Up @@ -117,14 +114,11 @@ export default function ReusableBlockEdit( { attributes: { ref }, clientId } ) {
<ToolbarGroup>
<ToolbarButton
onClick={ () => convertBlockToStatic( clientId ) }
label={
innerBlockCount > 1
? __( 'Detach patterns' )
: __( 'Detach pattern' )
}
icon={ ungroup }
label={ __( 'Detach' ) }
showTooltip
/>
>
{ __( 'Detach' ) }
</ToolbarButton>
</ToolbarGroup>
</BlockControls>
) }
Expand Down

0 comments on commit 7b48e38

Please sign in to comment.