forked from chrisleekr/binance-trading-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SymbolCancelIcon.js
49 lines (43 loc) · 1.09 KB
/
SymbolCancelIcon.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* eslint-disable no-unused-vars */
/* eslint-disable react/jsx-no-undef */
/* eslint-disable no-undef */
class SymbolCancelIcon extends React.Component {
constructor(props) {
super(props);
this.state = {
showModal: false,
isCancelled: false
};
this.handleCancel = this.handleCancel.bind(this);
}
handleCancel(e) {
e.preventDefault();
const { order } = this.props;
this.props.sendWebSocket('cancel-order', {
symbol: this.props.symbol,
order
});
this.setState({ isCancelled: true });
}
render() {
const { isAuthenticated } = this.props;
if (isAuthenticated === false) {
return '';
}
const { isCancelled } = this.state;
return (
<div className='header-column-icon-wrapper symbol-delete-wrapper'>
{isCancelled ? (
''
) : (
<button
type='button'
className='btn btn-sm btn-link p-0 pl-1 btn-cancel-order'
onClick={this.handleCancel}>
<i className='fas fa-times-circle'></i>
</button>
)}
</div>
);
}
}