|
49 | 49 | <MatChip Style="vertical-align: center" Label="@CurrencyUtils.GetCurrencyLabel(ActivePortfolio.Currency)"/>
|
50 | 50 | </MatChipSet>
|
51 | 51 | </MatHeadline6>
|
| 52 | + <span style="padding-left: 4px;">@ActivePortfolio.Description</span> |
52 | 53 | </div>
|
53 |
| - |
54 | 54 | <MatBody2 class="demo-mat-card-content clear-margin">
|
55 | 55 | <div class="mat-layout-grid">
|
56 | 56 | <div class="mat-layout-grid-inner" style="align-items: center">
|
57 | 57 | @if (PortfolioSummary != null)
|
58 | 58 | {
|
59 | 59 | <div class="mat-layout-grid-cell mat-layout-grid-cell-span-6">
|
60 |
| - |
61 |
| - <MatH4 Class="clear-margin">@(CurrencyUtils.Format(PortfolioSummary.MarketValue, ActivePortfolio.Currency))</MatH4> |
| 60 | + <LabelDecimalValue Label="Market Value" Value="@(CurrencyUtils.Format(PortfolioSummary.MarketValue, ActivePortfolio.Currency))"></LabelDecimalValue> |
62 | 61 | </div>
|
63 | 62 | <div class="mat-layout-grid-cell mat-layout-grid-cell-span-6" style="text-align: end">
|
64 |
| - @(DecimalUtils.FormatTwoDecimalPlacesWithPlusSign(PortfolioSummary.RelativeChange * 100m)) % |
| 63 | + <LabelDecimalValue Positive="PortfolioSummary.RelativeChange >= 0" ValueColorBasedOnValue="true" Label="Total Change" Value="@(DecimalUtils.FormatTwoDecimalPlacesWithPlusSign(PortfolioSummary.RelativeChange * 100m) + "%")"></LabelDecimalValue> |
65 | 64 | </div>
|
66 | 65 | }
|
67 | 66 | else
|
|
79 | 78 | <MatTableHeader>
|
80 | 79 | <th>Coin</th>
|
81 | 80 | <th>Price</th>
|
82 |
| - <th>Change (1h)</th> |
| 81 | + <th>Price change (1h)</th> |
83 | 82 | <th>Holdings</th>
|
84 | 83 | </MatTableHeader>
|
85 | 84 | <MatTableRow>
|
86 | 85 | <td>@context.Symbol.ToUpper()</td>
|
87 |
| - <td>@(CurrencyUtils.Format(context.CurrentPrice, ActivePortfolio.Currency))</td> |
88 |
| - <td style='color: @(context.RelativeChange >= 0 ? "#17a104" : "#FF0000")'>@DecimalUtils.FormatTwoDecimalPlaces(context.RelativeChange)%</td> |
89 |
| - <td>@context.Percentage%</td> |
| 86 | + <td><div style="min-width: 8rem">@(CurrencyUtils.Format(context.CurrentPrice, ActivePortfolio.Currency))</div></td> |
| 87 | + <td style='color: @(context.RelativeChange >= 0 ? "#17a104" : "#FF0000"); min-width: 7rem;'><div style="min-width: 6rem">@DecimalUtils.FormatTwoDecimalPlaces(context.RelativeChange)%</div></td> |
| 88 | + <td>@(CurrencyUtils.Format(context.MarketValue, ActivePortfolio.Currency)) (@(DecimalUtils.FormatTwoDecimalPlaces(context.Percentage))%)</td> |
90 | 89 | </MatTableRow>
|
91 | 90 | </MatTable>
|
92 | 91 | }
|
|
119 | 118 |
|
120 | 119 | protected List<PortfolioEntryRow> PortfolioEntryRows;
|
121 | 120 |
|
122 |
| - protected record PortfolioEntryRow(string Symbol, decimal CurrentPrice, decimal RelativeChange, decimal Percentage, int EntryId); |
| 121 | + protected record PortfolioEntryRow(string Symbol, decimal CurrentPrice, decimal RelativeChange, decimal Percentage, decimal AbsoluteChange, decimal MarketValue, int EntryId); |
123 | 122 |
|
124 | 123 | protected override void OnInitialized()
|
125 | 124 | {
|
|
189 | 188 | symbolsToMarketEntries[tuple.Second.Symbol].CurrentPrice,
|
190 | 189 | // asset's price change since the last 24h
|
191 | 190 | new decimal(symbolsToMarketEntries[tuple.Second.Symbol].PriceChangePercentage24H),
|
192 |
| - // percentage within the portfolio |
| 191 | + // percentage within the portfolio entry |
193 | 192 | portfolioTotalMarketValue > 0 ? (tuple.First.MarketValue / portfolioTotalMarketValue) * 100 : 0,
|
| 193 | + // absolute change within the portfolio entry |
| 194 | + tuple.First.AbsoluteChange, |
| 195 | + // market value |
| 196 | + tuple.First.MarketValue, |
194 | 197 | // pass the entry id
|
195 | 198 | tuple.Second.Id
|
196 | 199 | )
|
|
0 commit comments