diff options
Diffstat (limited to 'cmd/web/js')
-rw-r--r-- | cmd/web/js/account.jsx | 23 | ||||
-rw-r--r-- | cmd/web/js/balance.jsx | 13 | ||||
-rw-r--r-- | cmd/web/js/panel.jsx | 25 | ||||
-rw-r--r-- | cmd/web/js/poloniex.jsx | 20 |
4 files changed, 33 insertions, 48 deletions
diff --git a/cmd/web/js/account.jsx b/cmd/web/js/account.jsx index 3dc8afd..988d840 100644 --- a/cmd/web/js/account.jsx +++ b/cmd/web/js/account.jsx | |||
@@ -1,27 +1,6 @@ | |||
1 | import Api from './api.js'; | 1 | import Api from './api.js'; |
2 | import React from 'react'; | 2 | import React from 'react'; |
3 | import classnames from 'classnames'; | 3 | import Panel from './panel.js'; |
4 | |||
5 | class Panel extends React.Component { | ||
6 | render = () => { | ||
7 | if (this.props.component === null) { | ||
8 | return <div></div>; | ||
9 | } | ||
10 | |||
11 | var className = classnames('row', this.props.topClassName); | ||
12 | |||
13 | return ( | ||
14 | <div className={className}> | ||
15 | <div className="box col-12"> | ||
16 | <div className="row"> | ||
17 | <div className="col-4">{this.props.title}</div> | ||
18 | </div> | ||
19 | <hr/> | ||
20 | {this.props.component} | ||
21 | </div> | ||
22 | </div>); | ||
23 | } | ||
24 | } | ||
25 | 4 | ||
26 | class AccountInformation extends React.Component { | 5 | class AccountInformation extends React.Component { |
27 | constructor(props) { | 6 | constructor(props) { |
diff --git a/cmd/web/js/balance.jsx b/cmd/web/js/balance.jsx index d141aa8..515a7ed 100644 --- a/cmd/web/js/balance.jsx +++ b/cmd/web/js/balance.jsx | |||
@@ -1,14 +1,13 @@ | |||
1 | import React from 'react'; | 1 | import React from 'react'; |
2 | import moment from 'moment'; | 2 | import moment from 'moment'; |
3 | import classnames from 'classnames'; | ||
3 | 4 | ||
4 | class CurrencyLogo extends React.Component { | 5 | class CurrencyLogo extends React.Component { |
5 | render = () => { | 6 | render = () => { |
6 | return <div className="d-inline-block h-100"> | 7 | var className = classnames('cc', this.props.currency, 'currency-logo'); |
7 | <img className="currency-logo align-top" | 8 | return <i className={className} |
8 | src={'/public/icons/black/' + this.props.currency.toLowerCase() + '.svg' } | 9 | title={this.props.currency} |
9 | title={this.props.currency} | 10 | alt={this.props.currency}></i>; |
10 | alt={this.props.currency} /> | ||
11 | </div>; | ||
12 | } | 11 | } |
13 | } | 12 | } |
14 | 13 | ||
@@ -42,7 +41,7 @@ class CurrencyRate extends React.Component { | |||
42 | render = () => { | 41 | render = () => { |
43 | return <React.Fragment> | 42 | return <React.Fragment> |
44 | <div className="row text-center"> | 43 | <div className="row text-center"> |
45 | <div className="d-inline col-2 text-left"><CurrencyLogo currency={this.props.currency} /><span>{this.props.currency}</span></div> | 44 | <div className="d-inline col-2 text-left"><CurrencyLogo currency={this.props.currency} /> <span>{this.props.currency}</span></div> |
46 | <div className="d-inline col-2">{this.props.positionType}</div> | 45 | <div className="d-inline col-2">{this.props.positionType}</div> |
47 | <div className="d-inline col-2">{this.props.quantity}</div> | 46 | <div className="d-inline col-2">{this.props.quantity}</div> |
48 | <div className="d-inline col-2">{this.props.BTCValue}</div> | 47 | <div className="d-inline col-2">{this.props.BTCValue}</div> |
diff --git a/cmd/web/js/panel.jsx b/cmd/web/js/panel.jsx new file mode 100644 index 0000000..c293e9a --- /dev/null +++ b/cmd/web/js/panel.jsx | |||
@@ -0,0 +1,25 @@ | |||
1 | import React from 'react'; | ||
2 | import classnames from 'classnames'; | ||
3 | |||
4 | class Panel extends React.Component { | ||
5 | render = () => { | ||
6 | if (this.props.component === null) { | ||
7 | return <div></div>; | ||
8 | } | ||
9 | |||
10 | var className = classnames('row', this.props.topClassName); | ||
11 | |||
12 | return ( | ||
13 | <div className={className}> | ||
14 | <div className="box col-12"> | ||
15 | <div className="row"> | ||
16 | <div className="col-4">{this.props.title}</div> | ||
17 | </div> | ||
18 | <hr/> | ||
19 | {this.props.component} | ||
20 | </div> | ||
21 | </div>); | ||
22 | } | ||
23 | } | ||
24 | |||
25 | export default Panel; | ||
diff --git a/cmd/web/js/poloniex.jsx b/cmd/web/js/poloniex.jsx index b28bc26..5c374c3 100644 --- a/cmd/web/js/poloniex.jsx +++ b/cmd/web/js/poloniex.jsx | |||
@@ -1,6 +1,7 @@ | |||
1 | import Api from './api.js'; | 1 | import Api from './api.js'; |
2 | import React from 'react'; | 2 | import React from 'react'; |
3 | import {PFBalance, Assets} from './balance.js'; | 3 | import {PFBalance, Assets} from './balance.js'; |
4 | import Panel from './panel.js'; | ||
4 | 5 | ||
5 | class PoloniexController extends React.Component { | 6 | class PoloniexController extends React.Component { |
6 | constructor(props) { | 7 | constructor(props) { |
@@ -74,25 +75,6 @@ class PoloniexController extends React.Component { | |||
74 | } | 75 | } |
75 | } | 76 | } |
76 | 77 | ||
77 | class Panel extends React.Component { | ||
78 | render = () => { | ||
79 | if (this.props.component === null) { | ||
80 | return <div></div>; | ||
81 | } | ||
82 | |||
83 | return ( | ||
84 | <div className="row"> | ||
85 | <div className="box col-12"> | ||
86 | <div className="row"> | ||
87 | <div className="col-4">{this.props.title}</div> | ||
88 | </div> | ||
89 | <hr/> | ||
90 | {this.props.component} | ||
91 | </div> | ||
92 | </div>); | ||
93 | } | ||
94 | } | ||
95 | |||
96 | class PoloniexBalance extends React.Component { | 78 | class PoloniexBalance extends React.Component { |
97 | 79 | ||
98 | render = () => { | 80 | render = () => { |