Skip to content

Commit e26a5f0

Browse files
committed
Update the logic to be simpler
This was already refactored in #19778, but didn't need to remain that complicated.
1 parent 1346801 commit e26a5f0

File tree

1 file changed

+3
-9
lines changed
  • projects/plugins/jetpack/extensions/shared/external-media/media-button

1 file changed

+3
-9
lines changed

projects/plugins/jetpack/extensions/shared/external-media/media-button/media-menu.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ import MediaSources from './media-sources';
1313
function MediaButtonMenu( props ) {
1414
const { mediaProps, open, setSelectedSource, isFeatured, isReplace, hasImage } = props;
1515
const originalComponent = mediaProps.render;
16-
let isPrimary = isFeatured;
17-
let isSecondary = false;
18-
let isTertiary = ! isFeatured;
16+
let variant = 'tertiary';
1917

2018
if ( isReplace ) {
2119
return (
@@ -39,9 +37,7 @@ function MediaButtonMenu( props ) {
3937

4038
if ( isFeatured ) {
4139
label = __( 'Replace Image', 'jetpack' );
42-
isPrimary = false;
43-
isTertiary = false;
44-
isSecondary = true;
40+
variant = 'secondary';
4541
}
4642

4743
return (
@@ -60,9 +56,7 @@ function MediaButtonMenu( props ) {
6056
}
6157
return (
6258
<Button
63-
isPrimary={ isPrimary }
64-
isSecondary={ isSecondary }
65-
isTertiary={ isTertiary }
59+
variant={ variant }
6660
className="jetpack-external-media-button-menu"
6761
aria-haspopup="true"
6862
aria-expanded={ isOpen }

0 commit comments

Comments
 (0)