Add date column to benchmark component (#2466)

* Add date column to benchmark component
pull/2476/head
Aldrin 12 months ago committed by GitHub
parent fb3cd4b689
commit 5db984ffef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -6,14 +6,33 @@
</td> </td>
</ng-container> </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"> <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 <span class="d-none d-sm-block text-nowrap" i18n
>Change from All Time High</span >Change from All Time High</span
> >
<span class="d-block d-sm-none text-nowrap" i18n>from ATH</span> <span class="d-block d-sm-none text-nowrap" i18n>from ATH</span>
</th> </th>
<td *matCellDef="let element" class="text-right" mat-cell> <td *matCellDef="let element" class="px-2 text-right" mat-cell>
<gf-value <gf-value
class="d-inline-block justify-content-end" class="d-inline-block justify-content-end"
size="medium" size="medium"
@ -25,9 +44,7 @@
'text-success': 'text-success':
element?.performances?.allTimeHigh?.performancePercent > 0 element?.performances?.allTimeHigh?.performancePercent > 0
}" }"
[value]=" [value]="element?.performances?.allTimeHigh?.performancePercent"
element?.performances?.allTimeHigh?.performancePercent ?? undefined
"
></gf-value> ></gf-value>
</td> </td>
</ng-container> </ng-container>

@ -18,7 +18,7 @@ export class BenchmarkComponent implements OnChanges {
@Input() benchmarks: Benchmark[]; @Input() benchmarks: Benchmark[];
@Input() locale: string; @Input() locale: string;
public displayedColumns = ['name', 'change', 'marketCondition']; public displayedColumns = ['name', 'date', 'change', 'marketCondition'];
public resolveMarketCondition = resolveMarketCondition; public resolveMarketCondition = resolveMarketCondition;
public constructor() {} public constructor() {}

Loading…
Cancel
Save