Skip to content

Commit

Permalink
Template Part: Update switching trigger (#29257)
Browse files Browse the repository at this point in the history
* Swap the Chevron icon button for a text button

* use ToolbarButton component

Co-authored-by: Addison-Stavlo <stavz01@gmail.com>
  • Loading branch information
jameskoster and Addison-Stavlo authored Mar 4, 2021
1 parent 80b6e5b commit 9b26bd2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/block-library/src/template-part/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
Spinner,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { chevronUp, chevronDown } from '@wordpress/icons';
import { store as coreStore } from '@wordpress/core-data';

/**
Expand Down Expand Up @@ -116,15 +115,13 @@ export default function TemplatePartEdit( {
renderToggle={ ( { isOpen, onToggle } ) => (
<ToolbarButton
aria-expanded={ isOpen }
icon={
isOpen ? chevronUp : chevronDown
}
label={ __( 'Choose another' ) }
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' ) }
</ToolbarButton>
) }
renderContent={ ( { onClose } ) => (
<TemplatePartSelection
Expand Down

0 comments on commit 9b26bd2

Please sign in to comment.