Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/app/right-bar-creators/right-bar-creators.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@
</div>
</div>
</div>
<div *ngIf="globalVars.loggedInUser" class="d-flex justify-content-between pt-10px">
<div class="d-flex" style="min-width: 150px">Total Hodled</div>
<div class="d-flex align-items-center justify-content-end flex-wrap">
<div>
<!-- Amount in BitClout-->
≈ {{ globalVars.nanosToUSD(totalValue(), 2) }}
</div>

<div class="d-flex text-muted">
<!-- Amount in USD-->
<div class="ml-10px">USD</div>
</div>
</div>
</div>
</div>

<!-- Sign Up Flow -->
Expand Down
14 changes: 14 additions & 0 deletions src/app/right-bar-creators/right-bar-creators.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,18 @@ export class RightBarCreatorsComponent implements OnInit {
this.backendApi.SetStorage(RightBarCreatorsComponent.RightBarTabKey, this.activeTab);
}
}

totalValue() {
let result = 0;

for (const holding of this.globalVars.loggedInUser.UsersYouHODL) {
result +=
this.globalVars.bitcloutNanosYouWouldGetIfYouSold(
holding.BalanceNanos,
holding.ProfileEntryResponse.CoinEntry
) || 0;
}

return result;
}
}