Browse Source

feat(client): migrate showDetails to input signal

pull/7265/head
KenTandrian 1 week ago
parent
commit
a261556aba
  1. 2
      apps/client/src/app/components/portfolio-performance/portfolio-performance.component.html
  2. 4
      apps/client/src/app/components/portfolio-performance/portfolio-performance.component.ts

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

@ -32,7 +32,7 @@
{{ unit }} {{ unit }}
</div> </div>
</div> </div>
@if (showDetails) { @if (showDetails()) {
<div class="row"> <div class="row">
<div class="d-flex col justify-content-end"> <div class="d-flex col justify-content-end">
<gf-value <gf-value

4
apps/client/src/app/components/portfolio-performance/portfolio-performance.component.ts

@ -35,7 +35,6 @@ import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
templateUrl: './portfolio-performance.component.html' templateUrl: './portfolio-performance.component.html'
}) })
export class GfPortfolioPerformanceComponent implements OnChanges { export class GfPortfolioPerformanceComponent implements OnChanges {
@Input() showDetails: boolean;
@Input() unit: string; @Input() unit: string;
public readonly errors = input<ResponseError['errors']>(); public readonly errors = input<ResponseError['errors']>();
@ -47,6 +46,7 @@ export class GfPortfolioPerformanceComponent implements OnChanges {
return value !== undefined && value >= 0 ? value : 2; return value !== undefined && value >= 0 ? value : 2;
} }
}); });
public readonly showDetails = input<boolean>(false);
private readonly value = private readonly value =
viewChild.required<ElementRef<HTMLSpanElement>>('value'); viewChild.required<ElementRef<HTMLSpanElement>>('value');
@ -70,7 +70,7 @@ export class GfPortfolioPerformanceComponent implements OnChanges {
duration: 1, duration: 1,
separator: getNumberFormatGroup(this.locale()) separator: getNumberFormatGroup(this.locale())
}).start(); }).start();
} else if (this.showDetails === false) { } else if (this.showDetails() === false) {
new CountUp( new CountUp(
'value', 'value',
this.performance().netPerformancePercentageWithCurrencyEffect * 100, this.performance().netPerformancePercentageWithCurrencyEffect * 100,

Loading…
Cancel
Save