diff options
Diffstat (limited to 'cmd/web/js')
-rw-r--r-- | cmd/web/js/poloniex.jsx | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/cmd/web/js/poloniex.jsx b/cmd/web/js/poloniex.jsx index c0b68c7..482dbb6 100644 --- a/cmd/web/js/poloniex.jsx +++ b/cmd/web/js/poloniex.jsx | |||
@@ -1,5 +1,4 @@ | |||
1 | import Api from './api.js'; | 1 | import Api from './api.js'; |
2 | import classNames from 'classnames'; | ||
3 | import React from 'react'; | 2 | import React from 'react'; |
4 | 3 | ||
5 | class PoloniexController extends React.Component { | 4 | class PoloniexController extends React.Component { |
@@ -94,6 +93,15 @@ class PoloniexController extends React.Component { | |||
94 | } | 93 | } |
95 | } | 94 | } |
96 | 95 | ||
96 | class CurrencyLogo extends React.Component { | ||
97 | render = () => { | ||
98 | return <img className="currency-logo" | ||
99 | src={'/public/icons/black/' + this.props.currency.toLowerCase() + '.svg' } | ||
100 | title={this.props.currency} | ||
101 | alt={this.props.currency} />; | ||
102 | } | ||
103 | } | ||
104 | |||
97 | class PoloniexBalance extends React.Component { | 105 | class PoloniexBalance extends React.Component { |
98 | constructor(props) { | 106 | constructor(props) { |
99 | super(props); | 107 | super(props); |
@@ -106,19 +114,19 @@ class PoloniexBalance extends React.Component { | |||
106 | if (this.props.balanceValue !== null) { | 114 | if (this.props.balanceValue !== null) { |
107 | 115 | ||
108 | var balance = Object.keys(this.props.balance).map(function(currency) { | 116 | var balance = Object.keys(this.props.balance).map(function(currency) { |
109 | return <div key={currency}><i className={classNames('cc', currency)}></i> {this.props.balance[currency]}</div>; | 117 | return <div key={currency}> |
118 | <CurrencyLogo currency={currency} /> {this.props.balance[currency]} | ||
119 | </div>; | ||
110 | }.bind(this)); | 120 | }.bind(this)); |
111 | 121 | ||
112 | dashboard = | 122 | dashboard = |
113 | <div className="row"> | 123 | <div className="row"> |
114 | <div className="col-4 align-self-center h-100"> | 124 | <div className="col-4 align-self-center h-100 balances"> |
115 | <div> | ||
116 | {balance} | 125 | {balance} |
117 | </div> | ||
118 | </div> | 126 | </div> |
119 | <div className="offset-1 col-7 h-100 align-self-center"> | 127 | <div className="offset-1 col-7 h-100 align-self-center"> |
120 | <div className="text-center"> | 128 | <div className="text-center"> |
121 | Balance ({this.props.balanceCurrency}): <span>{this.props.balanceValue} <i className={classNames('cc', this.props.balanceCurrency)}></i></span> | 129 | Balance ({this.props.balanceCurrency}): <span>{this.props.balanceValue}</span><CurrencyLogo currency={this.props.balanceCurrency} /> |
122 | </div> | 130 | </div> |
123 | </div> | 131 | </div> |
124 | </div>; | 132 | </div>; |
@@ -133,7 +141,7 @@ class PoloniexBalance extends React.Component { | |||
133 | 141 | ||
134 | return ( | 142 | return ( |
135 | <div className="row"> | 143 | <div className="row"> |
136 | <div className="box offset-2 col-8"> | 144 | <div className="box offset-2 col-8 portfolio"> |
137 | <div className="row"> | 145 | <div className="row"> |
138 | <div className="col-4">Portfolio</div> | 146 | <div className="col-4">Portfolio</div> |
139 | </div> | 147 | </div> |