Skip to content

Commit

Permalink
fix: small corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMuzyk committed Jul 2, 2024
1 parent 0ac4188 commit 962f925
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type SubscriptionBillingBannerProps = Omit<BillingBannerProps, 'titleStyle' | 's
icon?: IconAsset;
};

function SubscriptionBillingBanner({title, subtitle, rightIcon, icon, isError, onRightIconPress, rightIconAccessibilityLabel}: SubscriptionBillingBannerProps) {
function SubscriptionBillingBanner({title, subtitle, rightIcon, icon, isError = false, onRightIconPress, rightIconAccessibilityLabel}: SubscriptionBillingBannerProps) {
const styles = useThemeStyles();

const iconAsset = icon ?? isError ? Illustrations.CreditCardEyes : Illustrations.CheckmarkCircle;
Expand Down
7 changes: 3 additions & 4 deletions src/pages/settings/Subscription/CardSection/CardSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function CardSection() {
let BillingBanner: React.ReactNode | undefined;
if (CardSectionUtils.shouldShowPreTrialBillingBanner()) {
BillingBanner = <PreTrialBillingBanner />;
} else if (billingStatus?.title && billingStatus?.subtitle) {
} else if (billingStatus) {
BillingBanner = (
<SubscriptionBillingBanner
title={billingStatus.title}
Expand Down Expand Up @@ -110,14 +110,13 @@ function CardSection() {
)}
{isEmptyObject(defaultCard?.accountData) && <CardSectionDataEmpty />}
</View>
{billingStatus?.isRetryAvailable && (
{billingStatus?.isRetryAvailable !== undefined && (
<Button
text={translate('subscription.cardSection.retryPaymentButton')}
isDisabled={isOffline}
isDisabled={isOffline || !billingStatus?.isRetryAvailable}
isLoading={subscriptionRetryBillingStatusPending}
onPress={handleRetryPayment}
style={[styles.w100, styles.mt5]}
success
large
/>
)}
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/Subscription/CardSection/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ function getBillingStatus(
title: translate('subscription.billingBanner.retryBillingError.title'),
subtitle: translate('subscription.billingBanner.retryBillingError.subtitle'),
isError: true,
isRetryAvailable: false,
};

default:
Expand Down

0 comments on commit 962f925

Please sign in to comment.