X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=cmd%2Fweb%2Fjs%2Fpoloniex.jsx;h=db6b1c43da71f123ec830dc8d6a8f89bffbe8146;hb=50c6eea630c5bf6d1513d093125f11ce30deaff5;hp=813a506a60d9af3e7a03426b4a1cd3577c32c08f;hpb=908ee2dd22c85d5d850f62b1a9d0066b43b80a69;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FFront.git diff --git a/cmd/web/js/poloniex.jsx b/cmd/web/js/poloniex.jsx index 813a506..db6b1c4 100644 --- a/cmd/web/js/poloniex.jsx +++ b/cmd/web/js/poloniex.jsx @@ -113,6 +113,10 @@ class PoloniexBalance extends React.Component { this.state = {'hideMsg': true, 'msg': '', 'msgOk': false}; } + computeCurrencyRatio = (currency) => { + return (parseFloat(this.props.balance[currency].btcValue) / parseFloat(this.props.balanceValue) * 100.0).toFixed(1); + } + render = () => { var dashboard = null; @@ -120,16 +124,18 @@ class PoloniexBalance extends React.Component { var balance = Object.keys(this.props.balance).map(function(currency) { return
- {this.props.balance[currency]} +
+ {this.props.balance[currency].amount} {currency} ({this.computeCurrencyRatio(currency)}%) +
; }.bind(this)); dashboard =
-
+
{balance}
-
+
Balance ({this.props.balanceCurrency}): {this.props.balanceValue}