aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/web/js/poloniex.jsx12
1 files changed, 9 insertions, 3 deletions
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 {
113 this.state = {'hideMsg': true, 'msg': '', 'msgOk': false}; 113 this.state = {'hideMsg': true, 'msg': '', 'msgOk': false};
114 } 114 }
115 115
116 computeCurrencyRatio = (currency) => {
117 return (parseFloat(this.props.balance[currency].btcValue) / parseFloat(this.props.balanceValue) * 100.0).toFixed(1);
118 }
119
116 render = () => { 120 render = () => {
117 var dashboard = null; 121 var dashboard = null;
118 122
@@ -120,16 +124,18 @@ class PoloniexBalance extends React.Component {
120 124
121 var balance = Object.keys(this.props.balance).map(function(currency) { 125 var balance = Object.keys(this.props.balance).map(function(currency) {
122 return <div key={currency}> 126 return <div key={currency}>
123 <CurrencyLogo currency={currency} /> {this.props.balance[currency]} 127 <div>
128 <CurrencyLogo currency={currency} /> {this.props.balance[currency].amount} {currency} ({this.computeCurrencyRatio(currency)}%)
129 </div>
124 </div>; 130 </div>;
125 }.bind(this)); 131 }.bind(this));
126 132
127 dashboard = 133 dashboard =
128 <div className="row"> 134 <div className="row">
129 <div className="col-4 align-self-center h-100 balances"> 135 <div className="col-6 align-self-center h-100 balances">
130 {balance} 136 {balance}
131 </div> 137 </div>
132 <div className="offset-1 col-7 h-100 align-self-center"> 138 <div className="offset-1 col-5 h-100 align-self-center">
133 <div className="text-center"> 139 <div className="text-center">
134 Balance ({this.props.balanceCurrency}): <span>{this.props.balanceValue}</span><CurrencyLogo currency={this.props.balanceCurrency} /> 140 Balance ({this.props.balanceCurrency}): <span>{this.props.balanceValue}</span><CurrencyLogo currency={this.props.balanceCurrency} />
135 </div> 141 </div>