Skip to content

Commit

Permalink
Replace all isPrimary references
Browse files Browse the repository at this point in the history
We use variant instead, since WordPress/gutenberg#31713
  • Loading branch information
jeherve committed Mar 4, 2022
1 parent 32d4faa commit 1346801
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion projects/plugins/jetpack/extensions/blocks/amazon/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function AmazonEdit( {
<Button
href={ detailPageUrl }
icon={ icon }
isPrimary
variant="primary"
className={ `${ defaultClassName }-button` }
style={ {
color: buttonTextColor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const ConvertToAudio = () => {
onClick={ handleClick }
onKeyDown={ handleClick }
>
<Button isPrimary href="https://anchor.fm/wordpressdotcom" target="_top">
<Button variant="primary" href="https://anchor.fm/wordpressdotcom" target="_top">
{ __( 'Create a podcast episode', 'jetpack' ) }{ ' ' }
<Icon icon={ external } className="anchor-post-publish-outbound-link__external_icon" />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function ButtonWidthControl( { align, width, onChange } ) {
<Button
key={ widthValue }
isSmall
isPrimary={ widthValue === width }
variant={ widthValue === width ? 'primary' : undefined }
onClick={ () => handleChange( widthValue ) }
>
{ widthValue }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function JetpackFieldWidth( { setAttributes, width } ) {
<Button
key={ widthValue }
isSmall
isPrimary={ widthValue === width }
variant={ widthValue === width ? 'primary' : undefined }
onClick={ () => setAttributes( { width: widthValue } ) }
>
{ widthValue }%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function ConversationEdit( {
className="wp-block-jetpack-slideshow__add-item-button"
onChange={ uploadTranscriptFile }
accept={ ACCEPTED_FILE_EXTENSIONS }
isPrimary
variant="primary"
title={ `${ __( 'Accepted file formats:', 'jetpack' ) } ${ ACCEPTED_FILE_EXTENSIONS }` }
disabled={ isProcessingFile }
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const InstagramGalleryEdit = props => {
) }
</p>
) }
<Button disabled={ isButtonDisabled } isPrimary onClick={ connectBlockToInstagram }>
<Button disabled={ isButtonDisabled } variant="primary" onClick={ connectBlockToInstagram }>
{ isConnecting && __( 'Connecting…', 'jetpack' ) }
{ isRequestingUserConnections && __( 'Loading your connections…', 'jetpack' ) }
{ ! isConnecting &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ const PodcastPlayerEdit = ( {
className={ 'components-placeholder__input' }
onChange={ editedUrl => dispatch( { type: actions.EDIT_URL, payload: editedUrl } ) }
/>
<Button isPrimary type="submit">
<Button variant="primary" type="submit">
{ __( 'Embed', 'jetpack' ) }
</Button>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export class MembershipsButtonEdit extends Component {
if ( this.state.addingMembershipAmount === PRODUCT_NOT_ADDING && ! forceShowForm ) {
return (
<Button
isPrimary
variant="primary"
onClick={ () => this.setState( { addingMembershipAmount: PRODUCT_FORM } ) }
>
{ __( 'Add a payment plan', 'jetpack' ) }
Expand Down Expand Up @@ -290,7 +290,7 @@ export class MembershipsButtonEdit extends Component {
/>
<div>
<Button
isPrimary
variant="primary"
className="membership-button__field-button membership-button__add-amount"
onClick={ this.saveProduct }
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function SocialPreviewsUpgrade() {
</ul>
<Button
href={ href } // Only for server-side rendering, since onClick doesn't work there.
isPrimary
variant="primary"
label={ __( 'Purchase a Business plan to access social previews', 'jetpack' ) }
onClick={ autosaveAndRedirect }
target="_top"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default function ResumableUpload( { file } ) {
'jetpack'
) }
</div>
<Button isPrimary onClick={ () => restartUpload() }>
<Button variant="primary" onClick={ () => restartUpload() }>
{ __( 'Try again', 'jetpack' ) }
</Button>
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,12 @@ function MediaBrowser( props ) {

return (
<div className="jetpack-external-media-browser__media__toolbar">
<Button isPrimary isBusy={ isCopying } disabled={ disabled } onClick={ onCopyAndInsert }>
<Button
variant="primary"
isBusy={ isCopying }
disabled={ disabled }
onClick={ onCopyAndInsert }
>
{ label }
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function GooglePhotosAuth( props ) {
<div className="jetpack-external-media-auth">
{ isAuthing ? <AuthProgress /> : <AuthInstructions /> }

<Button isPrimary disabled={ isAuthing } onClick={ onAuthorize }>
<Button variant="primary" disabled={ isAuthing } onClick={ onAuthorize }>
{ __( 'Connect to Google Photos', 'jetpack' ) }
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function PexelsMedia( props ) {
disabled={ !! isCopying }
/>
<Button
isPrimary
variant="primary"
onClick={ onSearch }
type="submit"
disabled={
Expand Down

0 comments on commit 1346801

Please sign in to comment.