From 6aaac4c0c5f79b2c7fecaf3217773deadd87ae98 Mon Sep 17 00:00:00 2001 From: Sahil Kandhare Date: Wed, 18 Dec 2024 20:28:48 +0530 Subject: [PATCH] feat: Dashboard > Home: Expense and Report Stats display the exact amount (#3365) --- .../dashboard/stat-badge/stat-badge.component.html | 11 ++++++++--- .../dashboard/stat-badge/stat-badge.component.scss | 9 +++------ .../dashboard/stat-badge/stat-badge.component.spec.ts | 3 ++- .../fyle/dashboard/stat-badge/stat-badge.component.ts | 5 ++++- src/app/fyle/dashboard/stats/stats.component.scss | 8 +++----- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/app/fyle/dashboard/stat-badge/stat-badge.component.html b/src/app/fyle/dashboard/stat-badge/stat-badge.component.html index bc4e4ceaff..a4b771f2bc 100644 --- a/src/app/fyle/dashboard/stat-badge/stat-badge.component.html +++ b/src/app/fyle/dashboard/stat-badge/stat-badge.component.html @@ -2,7 +2,7 @@
- +
- + @@ -44,7 +44,12 @@ {{ currencySymbol }} - {{ value | humanizeCurrency: currency:true }} + + {{ { value: value, currencyCode: currency, skipSymbol: true } | exactCurrency }} + + + {{ value | humanizeCurrency : currency : true }} +
{ beforeEach(waitForAsync(() => { const fyCurrencyPipeSpy = jasmine.createSpyObj('FyCurrencyPipe', ['transform']); TestBed.configureTestingModule({ - declarations: [StatBadgeComponent, HumanizeCurrencyPipe, FyCurrencyPipe], + declarations: [StatBadgeComponent, HumanizeCurrencyPipe, ExactCurrencyPipe, FyCurrencyPipe], imports: [IonicModule.forRoot()], providers: [ { diff --git a/src/app/fyle/dashboard/stat-badge/stat-badge.component.ts b/src/app/fyle/dashboard/stat-badge/stat-badge.component.ts index de97bf0f6d..85fc1cd201 100644 --- a/src/app/fyle/dashboard/stat-badge/stat-badge.component.ts +++ b/src/app/fyle/dashboard/stat-badge/stat-badge.component.ts @@ -25,7 +25,10 @@ export class StatBadgeComponent { @Output() badgeClicked = new EventEmitter(); - onBadgeClicked() { + // To track if the screen is small (370px or below) + isSmallScreen = window.innerWidth <= 370; + + onBadgeClicked(): void { if (!this.loading) { this.badgeClicked.emit(this.reportState); if (this.expenseState) { diff --git a/src/app/fyle/dashboard/stats/stats.component.scss b/src/app/fyle/dashboard/stats/stats.component.scss index 6de58c3d98..309386f265 100644 --- a/src/app/fyle/dashboard/stats/stats.component.scss +++ b/src/app/fyle/dashboard/stats/stats.component.scss @@ -20,7 +20,7 @@ $ccc-bank-name: #c4cae8; &--header { font-size: 14px; line-height: 18px; - color: $grey-light; + color: $black-light; font-weight: 500; } @@ -87,14 +87,12 @@ $ccc-bank-name: #c4cae8; } &--report-stats-row { - padding-bottom: 18px; - padding-top: 18px; + padding: 24px 0 20px 0; --ion-grid-column-padding: 0; } &--expenses-stats-row { - padding-bottom: 18px; - padding-top: 8px; + padding: 24px 0 20px 0; --ion-grid-column-padding: 0; } }