Skip to content

Commit 1b8ab68

Browse files
committed
Always show expensify code field and hide code only if secretPromoCode
1 parent 80366f6 commit 1b8ab68

1 file changed

Lines changed: 14 additions & 17 deletions

File tree

  • src/pages/settings/Subscription/SubscriptionSettings

src/pages/settings/Subscription/SubscriptionSettings/index.tsx

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ function SubscriptionSettings() {
8383
const {isSecretPromoCode, promoDiscountValue} = getPrivatePromoDiscountInfo(privatePromoDiscount, isAnnual);
8484

8585
const isExpensifyCodeApplied = !!privatePromoCode;
86-
const shouldShowExpensifyCodeSection = !isSecretPromoCode;
8786
const shouldShowExpensifyCodeHintText = isExpensifyCodeApplied && promoDiscountValue !== undefined;
8887
const subscriptionPrice = getSubscriptionPrice(subscriptionPlan, preferredCurrency, privateSubscription?.type, hasTeam2025Pricing);
8988
const priceDetails = translate(`subscription.yourPlan.${subscriptionPlan === CONST.POLICY.TYPE.CORPORATE ? 'control' : 'collect'}.${isAnnual ? 'priceAnnual' : 'pricePayPerUse'}`, {
@@ -317,22 +316,20 @@ function SubscriptionSettings() {
317316
) : null}
318317
</>
319318
)}
320-
{shouldShowExpensifyCodeSection && (
321-
<MenuItemWithTopDescription
322-
description={translate('subscription.expensifyCode.title')}
323-
shouldShowRightIcon={!isExpensifyCodeApplied}
324-
onPress={onExpensifyCodePress}
325-
interactive={!isExpensifyCodeApplied}
326-
wrapperStyle={styles.sectionMenuItemTopDescription}
327-
style={styles.mt5}
328-
title={privatePromoCode}
329-
hintText={
330-
shouldShowExpensifyCodeHintText
331-
? translate('subscription.expensifyCode.discountMessage', `${promoDiscountValue ?? ''}`, `${privatePromoCodeValidBillingCycles ?? ''}`)
332-
: undefined
333-
}
334-
/>
335-
)}
319+
<MenuItemWithTopDescription
320+
description={translate('subscription.expensifyCode.title')}
321+
shouldShowRightIcon={!isExpensifyCodeApplied}
322+
onPress={onExpensifyCodePress}
323+
interactive={!isExpensifyCodeApplied}
324+
wrapperStyle={styles.sectionMenuItemTopDescription}
325+
style={styles.mt5}
326+
title={isSecretPromoCode ? '' : privatePromoCode}
327+
hintText={
328+
shouldShowExpensifyCodeHintText
329+
? translate('subscription.expensifyCode.discountMessage', `${promoDiscountValue ?? ''}`, `${privatePromoCodeValidBillingCycles ?? ''}`)
330+
: undefined
331+
}
332+
/>
336333
{!!freebieCredits && freebieCredits > 0 && (
337334
<MenuItemWithTopDescription
338335
description={translate('subscription.details.creditBalance')}

0 commit comments

Comments
 (0)