From 97456861ed07651ca0d17f3e408c0defb1c4acdc Mon Sep 17 00:00:00 2001 From: Melissa 't Hart Date: Wed, 24 May 2023 18:14:21 +0200 Subject: [PATCH] feat: remove pricing on payment page for granted subscriptions --- src/components/Payment/Payment.tsx | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/components/Payment/Payment.tsx b/src/components/Payment/Payment.tsx index 52eb8083d..401445990 100644 --- a/src/components/Payment/Payment.tsx +++ b/src/components/Payment/Payment.tsx @@ -50,6 +50,7 @@ const Payment = ({ const hasMoreTransactions = hiddenTransactionsCount > 0; const navigate = useNavigate(); const location = useLocation(); + const isGrantedSubscription = activeSubscription?.period === 'granted'; function onCompleteSubscriptionClick() { navigate(addQueryParam(location, 'u', 'choose-offer')); @@ -92,16 +93,18 @@ const Payment = ({

{getTitle(activeSubscription.period)}
- {activeSubscription.status === 'active' && activeSubscription.period !== 'granted' + {activeSubscription.status === 'active' && !isGrantedSubscription ? t('user:payment.next_billing_date_on', { date: formatDate(activeSubscription.expiresAt) }) : t('user:payment.subscription_expires_on', { date: formatDate(activeSubscription.expiresAt) })}

-

- {formatPrice(activeSubscription.nextPaymentPrice, activeSubscription.nextPaymentCurrency, customer.country)} - /{t(`account:periods.${activeSubscription.period}`)} -

+ {!isGrantedSubscription && ( +

+ {formatPrice(activeSubscription.nextPaymentPrice, activeSubscription.nextPaymentCurrency, customer.country)} + /{t(`account:periods.${activeSubscription.period}`)} +

+ )}
- {activeSubscription.status === 'active' && activeSubscription.period !== 'granted' ? ( + {activeSubscription.status === 'active' && !isGrantedSubscription ? (