PremiumMainModal: Fix price for annual subscribe option (#4189)
This commit is contained in:
parent
88ff94c2bb
commit
aff3c0b92d
@ -255,6 +255,19 @@ const PremiumMainModal: FC<OwnProps & StateProps> = ({
|
|||||||
return Number(monthOption.amount);
|
return Number(monthOption.amount);
|
||||||
}, [promo]);
|
}, [promo]);
|
||||||
|
|
||||||
|
const subscribeButtonText = useMemo(() => {
|
||||||
|
if (!selectedSubscriptionOption) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const { amount, months, currency } = selectedSubscriptionOption;
|
||||||
|
const perMonthPrice = Math.floor(amount / months);
|
||||||
|
return formatCurrency(
|
||||||
|
perMonthPrice,
|
||||||
|
currency,
|
||||||
|
lang.code,
|
||||||
|
);
|
||||||
|
}, [selectedSubscriptionOption, lang.code]);
|
||||||
|
|
||||||
if (!promo || (fromUserStatusEmoji && !fromUserStatusSet)) return undefined;
|
if (!promo || (fromUserStatusEmoji && !fromUserStatusSet)) return undefined;
|
||||||
|
|
||||||
function getHeaderText() {
|
function getHeaderText() {
|
||||||
@ -397,12 +410,7 @@ const PremiumMainModal: FC<OwnProps & StateProps> = ({
|
|||||||
{!isPremium && selectedSubscriptionOption && (
|
{!isPremium && selectedSubscriptionOption && (
|
||||||
<div className={styles.footer}>
|
<div className={styles.footer}>
|
||||||
<Button className={styles.button} isShiny withPremiumGradient onClick={handleClick}>
|
<Button className={styles.button} isShiny withPremiumGradient onClick={handleClick}>
|
||||||
{lang('SubscribeToPremium',
|
{lang('SubscribeToPremium', subscribeButtonText)}
|
||||||
formatCurrency(
|
|
||||||
selectedSubscriptionOption.amount,
|
|
||||||
selectedSubscriptionOption.currency,
|
|
||||||
lang.code,
|
|
||||||
))}
|
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user