From bec38b6573f6ec177adedf7d9a1eeb001c40d0ae Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Wed, 17 Jul 2024 01:49:17 +0500 Subject: [PATCH 1/3] update subscription issues --- .../CardSection/BillingBanner/TrialStartedBillingBanner.tsx | 4 +++- src/pages/settings/Subscription/CardSection/CardSection.tsx | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pages/settings/Subscription/CardSection/BillingBanner/TrialStartedBillingBanner.tsx b/src/pages/settings/Subscription/CardSection/BillingBanner/TrialStartedBillingBanner.tsx index 7f4dce39d274..608a4a861c6a 100644 --- a/src/pages/settings/Subscription/CardSection/BillingBanner/TrialStartedBillingBanner.tsx +++ b/src/pages/settings/Subscription/CardSection/BillingBanner/TrialStartedBillingBanner.tsx @@ -7,10 +7,12 @@ import BillingBanner from './BillingBanner'; function TrialStartedBillingBanner() { const {translate} = useLocalize(); + const subtitle = !SubscriptionUtils.doesUserHavePaymentCardAdded() ? translate('subscription.billingBanner.trialStarted.subtitle') : ''; + return ( ); diff --git a/src/pages/settings/Subscription/CardSection/CardSection.tsx b/src/pages/settings/Subscription/CardSection/CardSection.tsx index 4cc160fc13b2..03c0c1fb537f 100644 --- a/src/pages/settings/Subscription/CardSection/CardSection.tsx +++ b/src/pages/settings/Subscription/CardSection/CardSection.tsx @@ -1,6 +1,6 @@ import React, {useCallback, useEffect, useMemo, useState} from 'react'; import {View} from 'react-native'; -import {useOnyx} from 'react-native-onyx'; +import Onyx, {useOnyx} from 'react-native-onyx'; import Button from '@components/Button'; import ConfirmModal from '@components/ConfirmModal'; import Icon from '@components/Icon'; @@ -77,7 +77,7 @@ function CardSection() { BillingBanner = ; } else if (SubscriptionUtils.isUserOnFreeTrial()) { BillingBanner = ; - } else if (SubscriptionUtils.hasUserFreeTrialEnded()) { + } else if (SubscriptionUtils.hasUserFreeTrialEnded() && !SubscriptionUtils.doesUserHavePaymentCardAdded()) { BillingBanner = ; } else if (billingStatus) { BillingBanner = ( From 5869792995469bd1484c0c370d58bc42639ab325 Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Wed, 17 Jul 2024 02:05:42 +0500 Subject: [PATCH 2/3] remove unused var --- src/pages/settings/Subscription/CardSection/CardSection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Subscription/CardSection/CardSection.tsx b/src/pages/settings/Subscription/CardSection/CardSection.tsx index 03c0c1fb537f..a10bde2d6236 100644 --- a/src/pages/settings/Subscription/CardSection/CardSection.tsx +++ b/src/pages/settings/Subscription/CardSection/CardSection.tsx @@ -1,6 +1,6 @@ import React, {useCallback, useEffect, useMemo, useState} from 'react'; import {View} from 'react-native'; -import Onyx, {useOnyx} from 'react-native-onyx'; +import {useOnyx} from 'react-native-onyx'; import Button from '@components/Button'; import ConfirmModal from '@components/ConfirmModal'; import Icon from '@components/Icon'; From 9ebd9718dd44c2025ff936f0e9658338a3a15542 Mon Sep 17 00:00:00 2001 From: Sibtain Ali Date: Wed, 17 Jul 2024 02:54:50 +0500 Subject: [PATCH 3/3] handle comments --- .../CardSection/BillingBanner/TrialEndedBillingBanner.tsx | 5 +++++ src/pages/settings/Subscription/CardSection/CardSection.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/settings/Subscription/CardSection/BillingBanner/TrialEndedBillingBanner.tsx b/src/pages/settings/Subscription/CardSection/BillingBanner/TrialEndedBillingBanner.tsx index ef321bf72e88..67dd37f7a844 100644 --- a/src/pages/settings/Subscription/CardSection/BillingBanner/TrialEndedBillingBanner.tsx +++ b/src/pages/settings/Subscription/CardSection/BillingBanner/TrialEndedBillingBanner.tsx @@ -1,11 +1,16 @@ import React from 'react'; import * as Illustrations from '@components/Icon/Illustrations'; import useLocalize from '@hooks/useLocalize'; +import * as SubscriptionUtils from '@libs/SubscriptionUtils'; import BillingBanner from './BillingBanner'; function TrialEndedBillingBanner() { const {translate} = useLocalize(); + if (SubscriptionUtils.doesUserHavePaymentCardAdded()) { + return null; + } + return ( ; } else if (SubscriptionUtils.isUserOnFreeTrial()) { BillingBanner = ; - } else if (SubscriptionUtils.hasUserFreeTrialEnded() && !SubscriptionUtils.doesUserHavePaymentCardAdded()) { + } else if (SubscriptionUtils.hasUserFreeTrialEnded()) { BillingBanner = ; } else if (billingStatus) { BillingBanner = (