Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// TODO: migrate Button usages to @wordpress/ui Link (handled in a separate PR — all Buttons here use variant="link" + href + isExternalLink + weight="regular", which @wordpress/ui Button does not support).
import { Button } from '@automattic/jetpack-components';
import { getUserConnectionUrl } from '@automattic/jetpack-connection';
import { getMyJetpackUrl } from '@automattic/jetpack-script-data';
import { dateI18n, getDate } from '@wordpress/date';
Expand Down Expand Up @@ -110,16 +108,16 @@ const PlanExpiry: FC< PlanSectionProps > = ( { purchase } ) => {

if ( isExpiringSoon ) {
return (
<Button href={ renewUrl } isExternalLink={ true } variant="link" weight="regular">
<Link href={ renewUrl } openInNewTab>
{ __( 'Renew subscription', 'jetpack-my-jetpack' ) }
</Button>
</Link>
);
}

return (
<Button href={ managePurchaseUrl } isExternalLink={ true } variant="link" weight="regular">
<Link href={ managePurchaseUrl } openInNewTab>
{ __( 'Resume subscription', 'jetpack-my-jetpack' ) }
</Button>
</Link>
);
}, [ isExpiringPurchase, isExpiringSoon, managePurchaseUrl, renewUrl ] );

Expand Down Expand Up @@ -243,39 +241,29 @@ const PlanSectionFooter: FC< PlanSectionHeaderAndFooterProps > = ( { numberOfPur
) }
{ numberOfPurchases > 0 && (
<li className={ styles[ 'actions-list-item' ] }>
<Button
<Link
onClick={ viewIncludedFeaturesClickHandler }
href={ getMyJetpackUrl( '#/products?filter=included' ) }
variant="link"
weight="regular"
>
{ __( 'View included features', 'jetpack-my-jetpack' ) }
</Button>
</Link>
</li>
) }
{ ! hasComplete && (
<li className={ styles[ 'actions-list-item' ] }>
<Button
onClick={ planPurchaseClickHandler }
href={ getPurchasePlanUrl() }
weight="regular"
variant="link"
isExternalLink={ true }
>
<Link onClick={ planPurchaseClickHandler } href={ getPurchasePlanUrl() } openInNewTab>
{ planPurchaseDescription }
</Button>
</Link>
</li>
) }
{ ! hasComplete && loadAddLicenseScreen && (
<li className={ styles[ 'actions-list-item' ] }>
<Button
<Link
onClick={ activateLicenseClickHandler }
href={ isUserConnected ? getMyJetpackUrl( '#/add-license' ) : getUserConnectionUrl() }
variant="link"
weight="regular"
>
{ activateLicenceDescription }
</Button>
</Link>
</li>
) }
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Text, Button, ThemeProvider, Col, Container } from '@automattic/jetpack-components';
import { Modal } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { Link } from '@wordpress/ui';
import clsx from 'clsx';
import { useCallback, useState, cloneElement } from 'react';
import LoadingBlock from '../loading-block';
Expand Down Expand Up @@ -234,13 +235,12 @@ const ProductInterstitialModal: FC< ProductInterstitialModalProps > = props => {
</div>
<div className={ styles[ 'primary-footer' ] }>
{ PrimaryButton }
<Button
variant="link"
isExternalLink={ secondaryButtonHasExternalLink }
<Link
openInNewTab={ secondaryButtonHasExternalLink }
href={ secondaryButtonHref }
>
{ __( 'Learn more', 'jetpack-my-jetpack' ) }
</Button>
</Link>
</div>
</Col>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ $interstitial-modal-padding: 40px;
.primary-footer {
display: flex;
flex-direction: row;
align-items: center;
gap: 8px 24px;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

My Jetpack: migrate link-variant Buttons in Plans section and product interstitial modal to @wordpress/ui Link.
Loading