Browse Source

Accentuate all time high and all time low

pull/428/head
Thomas 4 years ago
parent
commit
2b631d6e6b
  1. 8
      apps/api/src/app/portfolio/portfolio.service.ts
  2. 10
      apps/client/src/app/components/portfolio-performance/portfolio-performance.component.html
  3. 2
      libs/common/src/lib/interfaces/portfolio-performance.interface.ts

8
apps/api/src/app/portfolio/portfolio.service.ts

@ -639,7 +639,9 @@ export class PortfolioService {
currentGrossPerformancePercent: 0, currentGrossPerformancePercent: 0,
currentNetPerformance: 0, currentNetPerformance: 0,
currentNetPerformancePercent: 0, currentNetPerformancePercent: 0,
currentValue: 0 currentValue: 0,
isAllTimeHigh: false,
isAllTimeLow: false
} }
}; };
} }
@ -672,7 +674,9 @@ export class PortfolioService {
currentGrossPerformancePercent, currentGrossPerformancePercent,
currentNetPerformance, currentNetPerformance,
currentNetPerformancePercent, currentNetPerformancePercent,
currentValue currentValue,
isAllTimeHigh: true, // TODO
isAllTimeLow: false // TODO
} }
}; };
} }

10
apps/client/src/app/components/portfolio-performance/portfolio-performance.component.html

@ -1,5 +1,11 @@
<div class="container p-0"> <div class="container p-0">
<div class="row no-gutters"> <div
class="row no-gutters"
[ngClass]="{
'text-success': performance?.isAllTimeHigh,
'text-danger': performance?.isAllTimeLow
}"
>
<div class="flex-grow-1"></div> <div class="flex-grow-1"></div>
<div *ngIf="isLoading" class="align-items-center d-flex"> <div *ngIf="isLoading" class="align-items-center d-flex">
<ngx-skeleton-loader <ngx-skeleton-loader
@ -12,8 +18,8 @@
></ngx-skeleton-loader> ></ngx-skeleton-loader>
</div> </div>
<div <div
[hidden]="isLoading"
class="display-4 font-weight-bold m-0 text-center value-container" class="display-4 font-weight-bold m-0 text-center value-container"
[hidden]="isLoading"
> >
<span #value id="value"></span> <span #value id="value"></span>
</div> </div>

2
libs/common/src/lib/interfaces/portfolio-performance.interface.ts

@ -5,4 +5,6 @@ export interface PortfolioPerformance {
currentNetPerformance: number; currentNetPerformance: number;
currentNetPerformancePercent: number; currentNetPerformancePercent: number;
currentValue: number; currentValue: number;
isAllTimeHigh: boolean;
isAllTimeLow: boolean;
} }

Loading…
Cancel
Save