Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix monthly plan spotlight card CTA
Browse files Browse the repository at this point in the history
jeyip committed Oct 27, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 11663f1 commit 4773d1a
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion client/my-sites/plans-grid/components/actions.tsx
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@ type PlanFeaturesActionsButtonProps = {
isPopular?: boolean;
isInSignup?: boolean;
isLaunchPage?: boolean | null;
isMonthlyPlan?: boolean;
onUpgradeClick: ( overridePlanSlug?: PlanSlug ) => void;
planSlug: PlanSlug;
flowName?: string | null;
@@ -213,6 +214,7 @@ const LoggedInPlansFeatureActionButton = ( {
priceString,
isStuck,
isLargeCurrency,
isMonthlyPlan,
planTitle,
handleUpgradeButtonClick,
planSlug,
@@ -229,6 +231,7 @@ const LoggedInPlansFeatureActionButton = ( {
priceString: string | null;
isStuck: boolean;
isLargeCurrency: boolean;
isMonthlyPlan?: boolean;
planTitle: TranslateResult;
handleUpgradeButtonClick: () => void;
planSlug: PlanSlug;
@@ -290,7 +293,7 @@ const LoggedInPlansFeatureActionButton = ( {
}

if ( current && planSlug !== PLAN_P2_FREE ) {
if ( canPurchaseStorageAddOns && nonDefaultStorageOptionSelected ) {
if ( canPurchaseStorageAddOns && nonDefaultStorageOptionSelected && ! isMonthlyPlan ) {
return (
<Button
className={ classNames( classes, 'is-storage-upgradeable' ) }
@@ -441,6 +444,7 @@ const PlanFeaturesActionsButton: React.FC< PlanFeaturesActionsButtonProps > = (
planActionOverrides,
isStuck,
isLargeCurrency,
isMonthlyPlan,
storageOptions,
} ) => {
const translate = useTranslate();
@@ -557,6 +561,7 @@ const PlanFeaturesActionsButton: React.FC< PlanFeaturesActionsButtonProps > = (
priceString={ priceString }
isStuck={ isStuck }
isLargeCurrency={ !! isLargeCurrency }
isMonthlyPlan={ isMonthlyPlan }
planTitle={ planTitle }
storageOptions={ storageOptions }
/>
Original file line number Diff line number Diff line change
@@ -366,7 +366,7 @@ class FeaturesGrid extends Component< FeaturesGridType > {
} = this.props;

return renderedGridPlans.map(
( { planSlug, availableForPurchase, features: { storageOptions } } ) => {
( { planSlug, availableForPurchase, isMonthlyPlan, features: { storageOptions } } ) => {
const classes = classNames( 'plan-features-2023-grid__table-item', 'is-top-buttons' );

// Leaving it `undefined` makes it use the default label
@@ -400,6 +400,7 @@ class FeaturesGrid extends Component< FeaturesGridType > {
isWooExpressPlusPlan={ isWooExpressPlusPlan( planSlug ) }
isInSignup={ isInSignup }
isLaunchPage={ isLaunchPage }
isMonthlyPlan={ isMonthlyPlan }
onUpgradeClick={ ( overridePlanSlug ) =>
handleUpgradeClick( overridePlanSlug ?? planSlug )
}

0 comments on commit 4773d1a

Please sign in to comment.