Skip to content

Commit

Permalink
use ToolbarButton component
Browse files Browse the repository at this point in the history
  • Loading branch information
Addison-Stavlo committed Mar 3, 2021
1 parent a7d2443 commit 14ae17c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/block-library/src/template-part/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import {
Warning,
store as blockEditorStore,
} from '@wordpress/block-editor';
import { Button, Dropdown, ToolbarGroup, Spinner } from '@wordpress/components';
import {
Dropdown,
ToolbarGroup,
ToolbarButton,
Spinner,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { store as coreStore } from '@wordpress/core-data';

Expand Down Expand Up @@ -108,15 +113,15 @@ export default function TemplatePartEdit( {
contentClassName="wp-block-template-part__preview-dropdown-content"
position="bottom right left"
renderToggle={ ( { isOpen, onToggle } ) => (
<Button
<ToolbarButton
aria-expanded={ isOpen }
onClick={ onToggle }
// Disable when open to prevent odd FireFox bug causing reopening.
// As noted in https://github.com/WordPress/gutenberg/pull/24990#issuecomment-689094119 .
disabled={ isOpen }
>
{ __( 'Replace' ) }
</Button>
</ToolbarButton>
) }
renderContent={ ( { onClose } ) => (
<TemplatePartSelection
Expand Down

0 comments on commit 14ae17c

Please sign in to comment.