[WEB-4040] fix: minor changes in base plan names (#7656)
This commit is contained in:
parent
aef465415b
commit
e0912ccefc
4 changed files with 3 additions and 14 deletions
|
|
@ -19,7 +19,6 @@ export type TBasePaidPlanCardProps = {
|
||||||
extraFeatures?: string | React.ReactNode;
|
extraFeatures?: string | React.ReactNode;
|
||||||
renderPriceContent: (price: TSubscriptionPrice) => React.ReactNode;
|
renderPriceContent: (price: TSubscriptionPrice) => React.ReactNode;
|
||||||
renderActionButton: (price: TSubscriptionPrice) => React.ReactNode;
|
renderActionButton: (price: TSubscriptionPrice) => React.ReactNode;
|
||||||
isSelfHosted: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const BasePaidPlanCard: FC<TBasePaidPlanCardProps> = observer((props) => {
|
export const BasePaidPlanCard: FC<TBasePaidPlanCardProps> = observer((props) => {
|
||||||
|
|
@ -31,11 +30,10 @@ export const BasePaidPlanCard: FC<TBasePaidPlanCardProps> = observer((props) =>
|
||||||
extraFeatures,
|
extraFeatures,
|
||||||
renderPriceContent,
|
renderPriceContent,
|
||||||
renderActionButton,
|
renderActionButton,
|
||||||
isSelfHosted,
|
|
||||||
} = props;
|
} = props;
|
||||||
// states
|
// states
|
||||||
const [selectedPlan, setSelectedPlan] = useState<TBillingFrequency>("month");
|
const [selectedPlan, setSelectedPlan] = useState<TBillingFrequency>("month");
|
||||||
const basePlan = getBaseSubscriptionName(planVariant, isSelfHosted);
|
const basePlan = getBaseSubscriptionName(planVariant);
|
||||||
const upgradeCardVariantStyle = getUpgradeCardVariantStyle(planVariant);
|
const upgradeCardVariantStyle = getUpgradeCardVariantStyle(planVariant);
|
||||||
// Plane details
|
// Plane details
|
||||||
const planeName = getSubscriptionName(planVariant);
|
const planeName = getSubscriptionName(planVariant);
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,6 @@ export const PlanUpgradeCard: FC<PlanUpgradeCardProps> = observer((props) => {
|
||||||
isTrialAllowed={isTrialAllowed}
|
isTrialAllowed={isTrialAllowed}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
isSelfHosted={isSelfHosted}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,6 @@ export const TalkToSalesCard: FC<TalkToSalesCardProps> = observer((props) => {
|
||||||
extraFeatures={extraFeatures}
|
extraFeatures={extraFeatures}
|
||||||
renderPriceContent={renderPriceContent}
|
renderPriceContent={renderPriceContent}
|
||||||
renderActionButton={renderActionButton}
|
renderActionButton={renderActionButton}
|
||||||
isSelfHosted={isSelfHosted}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -41,21 +41,14 @@ export const getSubscriptionName = (planVariant: EProductSubscriptionEnum): stri
|
||||||
/**
|
/**
|
||||||
* Gets the base subscription name for upgrade/downgrade paths
|
* Gets the base subscription name for upgrade/downgrade paths
|
||||||
* @param planVariant - The current subscription plan variant
|
* @param planVariant - The current subscription plan variant
|
||||||
* @param isSelfHosted - Whether the instance is self-hosted / community
|
|
||||||
* @returns The name of the base subscription plan
|
* @returns The name of the base subscription plan
|
||||||
*
|
|
||||||
* @remarks
|
|
||||||
* - For self-hosted / community instances, the upgrade path differs from cloud instances
|
|
||||||
* - Returns the immediate lower tier subscription name
|
|
||||||
*/
|
*/
|
||||||
export const getBaseSubscriptionName = (planVariant: TProductSubscriptionType, isSelfHosted: boolean): string => {
|
export const getBaseSubscriptionName = (planVariant: TProductSubscriptionType): string => {
|
||||||
switch (planVariant) {
|
switch (planVariant) {
|
||||||
case EProductSubscriptionEnum.ONE:
|
case EProductSubscriptionEnum.ONE:
|
||||||
return getSubscriptionName(EProductSubscriptionEnum.FREE);
|
return getSubscriptionName(EProductSubscriptionEnum.FREE);
|
||||||
case EProductSubscriptionEnum.PRO:
|
case EProductSubscriptionEnum.PRO:
|
||||||
return isSelfHosted
|
return getSubscriptionName(EProductSubscriptionEnum.FREE);
|
||||||
? getSubscriptionName(EProductSubscriptionEnum.ONE)
|
|
||||||
: getSubscriptionName(EProductSubscriptionEnum.FREE);
|
|
||||||
case EProductSubscriptionEnum.BUSINESS:
|
case EProductSubscriptionEnum.BUSINESS:
|
||||||
return getSubscriptionName(EProductSubscriptionEnum.PRO);
|
return getSubscriptionName(EProductSubscriptionEnum.PRO);
|
||||||
case EProductSubscriptionEnum.ENTERPRISE:
|
case EProductSubscriptionEnum.ENTERPRISE:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue