fix cancelled subscription state for plan selector
This commit is contained in:
parent
f66fa83376
commit
d58ff9cf78
|
@ -4,7 +4,7 @@ import Box from '@mui/material/Box';
|
||||||
import Typography from '@mui/material/Typography';
|
import Typography from '@mui/material/Typography';
|
||||||
import { SpaceBetweenFlex } from 'components/Container';
|
import { SpaceBetweenFlex } from 'components/Container';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { convertBytesToGBs } from 'utils/billing';
|
import { convertBytesToGBs, isSubscriptionCancelled } from 'utils/billing';
|
||||||
import constants from 'utils/strings/constants';
|
import constants from 'utils/strings/constants';
|
||||||
import { ManageSubscription } from '../manageSubscription';
|
import { ManageSubscription } from '../manageSubscription';
|
||||||
import { PeriodToggler } from '../periodToggler';
|
import { PeriodToggler } from '../periodToggler';
|
||||||
|
@ -76,7 +76,11 @@ export default function PaidSubscriptionPlanSelectorCard({
|
||||||
|
|
||||||
<Box py={1} px={1.5}>
|
<Box py={1} px={1.5}>
|
||||||
<Typography color={'text.secondary'}>
|
<Typography color={'text.secondary'}>
|
||||||
{constants.RENEWAL_ACTIVE_SUBSCRIPTION_INFO(
|
{!isSubscriptionCancelled(subscription)
|
||||||
|
? constants.RENEWAL_ACTIVE_SUBSCRIPTION_STATUS(
|
||||||
|
subscription.expiryTime
|
||||||
|
)
|
||||||
|
: constants.RENEWAL_CANCELLED_SUBSCRIPTION_STATUS(
|
||||||
subscription.expiryTime
|
subscription.expiryTime
|
||||||
)}
|
)}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|
|
@ -270,9 +270,12 @@ const englishConstants = {
|
||||||
|
|
||||||
FAMILY_SUBSCRIPTION_INFO: 'You are on a family plan managed by',
|
FAMILY_SUBSCRIPTION_INFO: 'You are on a family plan managed by',
|
||||||
|
|
||||||
RENEWAL_ACTIVE_SUBSCRIPTION_INFO: (expiryTime) => (
|
RENEWAL_ACTIVE_SUBSCRIPTION_STATUS: (expiryTime) => (
|
||||||
<>Renews on {dateString(expiryTime)}</>
|
<>Renews on {dateString(expiryTime)}</>
|
||||||
),
|
),
|
||||||
|
RENEWAL_CANCELLED_SUBSCRIPTION_STATUS: (expiryTime) => (
|
||||||
|
<>Ends on {dateString(expiryTime)}</>
|
||||||
|
),
|
||||||
|
|
||||||
RENEWAL_CANCELLED_SUBSCRIPTION_INFO: (expiryTime) => (
|
RENEWAL_CANCELLED_SUBSCRIPTION_INFO: (expiryTime) => (
|
||||||
<>Your subscription will be cancelled on {dateString(expiryTime)}</>
|
<>Your subscription will be cancelled on {dateString(expiryTime)}</>
|
||||||
|
|
Loading…
Reference in a new issue