Wired free trial offer UI in offers list

refs https://github.com/TryGhost/Team/issues/1726

- refines UI for a trial offer in offer list
This commit is contained in:
Rishabh 2022-08-10 16:02:34 +05:30 committed by Rishabh Garg
parent b8acc9ef19
commit 7130fc2833
2 changed files with 17 additions and 7 deletions

View File

@ -44,7 +44,11 @@ export default class MembersController extends Controller {
const price = offer.cadence === 'month' ? tier.monthlyPrice : tier.yearlyPrice;
offer.finalCurrency = offer.currency || tier.currency;
offer.originalPrice = price;
offer.updatedPrice = offer.type === 'fixed' ? (price - offer.amount) : (price - ((price * offer.amount) / 100));
if (offer.type !== 'trial') {
offer.updatedPrice = offer.type === 'fixed' ? (price - offer.amount) : (price - ((price * offer.amount) / 100));
} else {
offer.updatedPrice = offer.originalPrice;
}
return offer;
});
}

View File

@ -64,17 +64,23 @@
{{#if (feature 'freeTrial')}}
{{#if (eq offer.type 'trial')}}
<span class="pink">{{svg-jar "offer"}}</span>
<span class="pink fw6"><span class="ttu">21</span> DAYS FREE</span>
<span class="pink fw6"><span class="ttu">{{offer.amount}}</span> DAYS FREE</span>
{{/if}}
{{/if}}
<span class="dib ml1 midgrey ttc">  
{{if (eq offer.duration 'once') "First-payment" "Repeating"}}
</span>
{{#if (not (eq offer.type 'trial'))}}
<span class="dib ml1 midgrey ttc">  
{{if (eq offer.duration 'once') "First-payment" "Repeating"}}
</span>
{{/if}}
</span>
</LinkTo>
<LinkTo @route="offer" @model={{offer}} class="gh-list-data">
<span>{{currency-symbol offer.finalCurrency}}{{gh-price-amount offer.updatedPrice}}</span>
<span class="midgrey strike ml2">{{currency-symbol offer.finalCurrency}}{{gh-price-amount offer.originalPrice}}</span>
{{#if (eq offer.type 'trial')}}
<span>{{currency-symbol offer.finalCurrency}}{{gh-price-amount offer.originalPrice}}</span>
{{else}}
<span>{{currency-symbol offer.finalCurrency}}{{gh-price-amount offer.updatedPrice}}</span>
<span class="midgrey strike ml2">{{currency-symbol offer.finalCurrency}}{{gh-price-amount offer.originalPrice}}</span>
{{/if}}
</LinkTo>
<LinkTo @route="offer" @model={{offer}} class="gh-list-data">
<span class="midgrey">{{offer.redemptionCount}}</span>