Skip to content

Commit

Permalink
Add a tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 committed Feb 10, 2023
1 parent c905dc5 commit 107abe4
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions packages/block-library/src/template-part/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ import {
__experimentalUseHasRecursion as useHasRecursion,
BlockControls,
} from '@wordpress/block-editor';
import { Spinner, Modal, MenuItem, ToolbarButton } from '@wordpress/components';
import {
Spinner,
Modal,
MenuItem,
ToolbarButton,
Tooltip,
} from '@wordpress/components';
import { __, sprintf } from '@wordpress/i18n';
import { store as coreStore } from '@wordpress/core-data';
import { useState, createInterpolateElement } from '@wordpress/element';
Expand Down Expand Up @@ -188,9 +194,14 @@ export default function TemplatePartEdit( {
) }
</BlockSettingsMenuControls>
<BlockControls group="other">
<ToolbarButton onClick={ shuffleTemplatePart }>
{ __( 'Shuffle' ) }
</ToolbarButton>
<Tooltip
position="top center"
text={ __( 'Try a different design' ) }
>
<ToolbarButton onClick={ shuffleTemplatePart }>
{ __( 'Shuffle' ) }
</ToolbarButton>
</Tooltip>
</BlockControls>
</>
) }
Expand Down

0 comments on commit 107abe4

Please sign in to comment.