Added percent class to newsletter open rate on Dashboard

This commit is contained in:
Peter Zimon 2021-03-05 12:46:32 +01:00
parent 6dd07c1421
commit b053f1d284
2 changed files with 2 additions and 1 deletions

View File

@ -183,6 +183,7 @@ export default class DashboardController extends Controller {
const percentGrowth = rangeStartOpenRate !== 0 ? ((rangeEndOpenRate - rangeStartOpenRate) / rangeStartOpenRate) * 100 : 0;
this.newsletterOpenRatesData = {
percentGrowth: percentGrowth.toFixed(1),
percentClass: (percentGrowth > 0 ? 'positive' : (percentGrowth < 0 ? 'negative' : '')),
current: rangeEndOpenRate,
options: {
rangeInDays: 30

View File

@ -122,7 +122,7 @@
<div class="data-container">
<div class="data">{{this.newsletterOpenRatesData.current}}%</div>
<div class="growth {{this.mrrStatsData.percentClass}}">{{this.newsletterOpenRatesData.percentGrowth}}%</div>
<div class="growth {{this.newsletterOpenRatesData.percentClass}}">{{this.newsletterOpenRatesData.percentGrowth}}%</div>
</div>
</div>
<div class="gh-dashboard-chart small">