aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/js
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/web/js')
-rw-r--r--cmd/web/js/account.jsx23
-rw-r--r--cmd/web/js/balance.jsx13
-rw-r--r--cmd/web/js/panel.jsx25
-rw-r--r--cmd/web/js/poloniex.jsx20
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 @@
1import Api from './api.js'; 1import Api from './api.js';
2import React from 'react'; 2import React from 'react';
3import classnames from 'classnames'; 3import Panel from './panel.js';
4
5class 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
26class AccountInformation extends React.Component { 5class 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 @@
1import React from 'react'; 1import React from 'react';
2import moment from 'moment'; 2import moment from 'moment';
3import classnames from 'classnames';
3 4
4class CurrencyLogo extends React.Component { 5class 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 @@
1import React from 'react';
2import classnames from 'classnames';
3
4class 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
25export 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 @@
1import Api from './api.js'; 1import Api from './api.js';
2import React from 'react'; 2import React from 'react';
3import {PFBalance, Assets} from './balance.js'; 3import {PFBalance, Assets} from './balance.js';
4import Panel from './panel.js';
4 5
5class PoloniexController extends React.Component { 6class 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
77class 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
96class PoloniexBalance extends React.Component { 78class PoloniexBalance extends React.Component {
97 79
98 render = () => { 80 render = () => {