0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Cleaned up trial days display

This commit is contained in:
Rishabh 2022-08-19 19:03:08 +05:30
parent d5dedd4765
commit 2c636d16eb

View file

@ -565,9 +565,9 @@ function ProductCardAlternatePrice({price}) {
);
}
function ProductCardTrialDays({trialDays, discount}) {
function ProductCardTrialDays({trialDays, discount, selectedInterval}) {
const {site} = useContext(AppContext);
const {selectedInterval} = useContext(ProductsContext);
if (hasFreeTrialTier({site})) {
if (trialDays) {
return (
@ -583,7 +583,7 @@ function ProductCardTrialDays({trialDays, discount}) {
<span className="gh-portal-discount-label">{discount}% discount</span>
);
}
return null;
}
@ -611,7 +611,7 @@ function ProductCardPrice({product}) {
<span className="amount">{formatNumber(getStripeAmount(activePrice.amount))}</span>
<span className="billing-period">/{activePrice.interval}</span>
</div>
<ProductCardTrialDays trialDays={trialDays} discount={yearlyDiscount} />
<ProductCardTrialDays trialDays={trialDays} discount={yearlyDiscount} selectedInterval={selectedInterval} />
</div>
{(selectedInterval === 'year' ? <YearlyDiscount discount={yearlyDiscount} trialDays={trialDays} /> : '')}
<ProductCardAlternatePrice price={alternatePrice} />