Add date column to benchmark component (#2466)
* Add date column to benchmark component
This commit is contained in:
parent
fb3cd4b689
commit
5db984ffef
@ -6,14 +6,33 @@
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="date">
|
||||
<th
|
||||
*matHeaderCellDef
|
||||
class="d-none d-lg-table-cell px-2 text-right"
|
||||
mat-header-cell
|
||||
>
|
||||
<ng-container i18n>Last All Time High</ng-container>
|
||||
</th>
|
||||
<td *matCellDef="let element" class="d-none d-lg-table-cell px-2" mat-cell>
|
||||
<div class="d-flex justify-content-end">
|
||||
<gf-value
|
||||
[isDate]="true"
|
||||
[locale]="locale"
|
||||
[value]="element?.performances?.allTimeHigh?.date"
|
||||
></gf-value>
|
||||
</div>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="change">
|
||||
<th *matHeaderCellDef class="text-right" mat-header-cell>
|
||||
<th *matHeaderCellDef class="px-2 text-right" mat-header-cell>
|
||||
<span class="d-none d-sm-block text-nowrap" i18n
|
||||
>Change from All Time High</span
|
||||
>
|
||||
<span class="d-block d-sm-none text-nowrap" i18n>from ATH</span>
|
||||
</th>
|
||||
<td *matCellDef="let element" class="text-right" mat-cell>
|
||||
<td *matCellDef="let element" class="px-2 text-right" mat-cell>
|
||||
<gf-value
|
||||
class="d-inline-block justify-content-end"
|
||||
size="medium"
|
||||
@ -25,9 +44,7 @@
|
||||
'text-success':
|
||||
element?.performances?.allTimeHigh?.performancePercent > 0
|
||||
}"
|
||||
[value]="
|
||||
element?.performances?.allTimeHigh?.performancePercent ?? undefined
|
||||
"
|
||||
[value]="element?.performances?.allTimeHigh?.performancePercent"
|
||||
></gf-value>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
@ -18,7 +18,7 @@ export class BenchmarkComponent implements OnChanges {
|
||||
@Input() benchmarks: Benchmark[];
|
||||
@Input() locale: string;
|
||||
|
||||
public displayedColumns = ['name', 'change', 'marketCondition'];
|
||||
public displayedColumns = ['name', 'date', 'change', 'marketCondition'];
|
||||
public resolveMarketCondition = resolveMarketCondition;
|
||||
|
||||
public constructor() {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user