Skip to content

Commit

Permalink
[not verified] ditch extraProps, just use isSecondary straight up
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwiebe committed May 4, 2021
1 parent d69e9e4 commit 5f10a45
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ function MediaButtonMenu( props ) {
const { mediaProps, open, setSelectedSource, isFeatured, isReplace, hasImage } = props;
const originalComponent = mediaProps.render;
let isPrimary = isFeatured;
let isSecondary = false;
let isTertiary = ! isFeatured;
const extraProps = {};

if ( isReplace ) {
return (
Expand All @@ -41,7 +41,7 @@ function MediaButtonMenu( props ) {
label = __( 'Replace Image', 'jetpack' );
isPrimary = false;
isTertiary = false;
extraProps.isSecondary = true;
isSecondary = true;
}

return (
Expand All @@ -58,13 +58,13 @@ function MediaButtonMenu( props ) {
originalComponent( { open: onToggle } )
) : (
<Button
isTertiary={ isTertiary }
isPrimary={ isPrimary }
isSecondary={ isSecondary }
isTertiary={ isTertiary }
className="jetpack-external-media-button-menu"
aria-haspopup="true"
aria-expanded={ isOpen }
onClick={ onToggle }
{ ...extraProps }
>
{ label }
</Button>
Expand Down

0 comments on commit 5f10a45

Please sign in to comment.