|
|
|
@ -18,6 +18,7 @@ import { IonIcon } from '@ionic/angular/standalone'; |
|
|
|
import { formatDistanceToNow } from 'date-fns'; |
|
|
|
import { addIcons } from 'ionicons'; |
|
|
|
import { |
|
|
|
caretForwardOutline, |
|
|
|
ellipsisHorizontalCircleOutline, |
|
|
|
informationCircleOutline |
|
|
|
} from 'ionicons/icons'; |
|
|
|
@ -47,13 +48,19 @@ export class GfPortfolioSummaryComponent implements OnChanges { |
|
|
|
'BUY_AND_SELL_ACTIVITIES_TOOLTIP' |
|
|
|
); |
|
|
|
|
|
|
|
protected isCashExpanded = false; |
|
|
|
protected isHoldingsExpanded = false; |
|
|
|
protected precision = 2; |
|
|
|
protected timeInMarket: string | undefined; |
|
|
|
|
|
|
|
private readonly notificationService = inject(NotificationService); |
|
|
|
|
|
|
|
public constructor() { |
|
|
|
addIcons({ ellipsisHorizontalCircleOutline, informationCircleOutline }); |
|
|
|
addIcons({ |
|
|
|
caretForwardOutline, |
|
|
|
ellipsisHorizontalCircleOutline, |
|
|
|
informationCircleOutline |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
protected get cashPercentage() { |
|
|
|
@ -77,6 +84,14 @@ export class GfPortfolioSummaryComponent implements OnChanges { |
|
|
|
: 0; |
|
|
|
} |
|
|
|
|
|
|
|
protected get hasCashBreakdown() { |
|
|
|
return !this.isLoading && this.summary?.emergencyFund?.cash > 0; |
|
|
|
} |
|
|
|
|
|
|
|
protected get hasHoldingsBreakdown() { |
|
|
|
return !this.isLoading && this.summary?.emergencyFund?.assets > 0; |
|
|
|
} |
|
|
|
|
|
|
|
protected get holdingsInBaseCurrency() { |
|
|
|
if ( |
|
|
|
!isNumber(this.summary?.totalAssetsInBaseCurrency) || |
|
|
|
@ -145,4 +160,12 @@ export class GfPortfolioSummaryComponent implements OnChanges { |
|
|
|
title: $localize`Please set the amount of your emergency fund.` |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
protected onToggleCash() { |
|
|
|
this.isCashExpanded = !this.isCashExpanded; |
|
|
|
} |
|
|
|
|
|
|
|
protected onToggleHoldings() { |
|
|
|
this.isHoldingsExpanded = !this.isHoldingsExpanded; |
|
|
|
} |
|
|
|
} |
|
|
|
|