@@ -2,11 +2,7 @@ import { CombinedOrderBook, Decimal, Loader } from '@openware/components';
2
2
import classNames from 'classnames' ;
3
3
import * as React from 'react' ;
4
4
import { InjectedIntlProps , injectIntl } from 'react-intl' ;
5
- import {
6
- connect ,
7
- MapDispatchToPropsFunction ,
8
- MapStateToProps ,
9
- } from 'react-redux' ;
5
+ import { connect , MapDispatchToPropsFunction } from 'react-redux' ;
10
6
import { accumulateVolume , calcMaxVolume , sortAsks , sortBids } from '../../helpers' ;
11
7
import {
12
8
Market ,
@@ -21,11 +17,11 @@ import {
21
17
} from '../../modules' ;
22
18
23
19
interface ReduxProps {
24
- bids : string [ ] [ ] ;
25
- isLoading : boolean ;
26
20
asks : string [ ] [ ] ;
21
+ bids : string [ ] [ ] ;
27
22
currentMarket : Market | undefined ;
28
23
currentPrice : number | undefined ;
24
+ orderBookLoading : boolean ;
29
25
}
30
26
31
27
interface DispatchProps {
@@ -63,17 +59,21 @@ class OrderBookContainer extends React.Component<Props, State> {
63
59
}
64
60
65
61
public render ( ) {
66
- const { bids, isLoading, asks } = this . props ;
62
+ const {
63
+ asks,
64
+ bids,
65
+ orderBookLoading,
66
+ } = this . props ;
67
67
const isLarge = this . state . width > breakpoint ;
68
68
const cn = classNames ( 'pg-combined-order-book ' , {
69
- 'cr-combined-order-book--loading' : isLoading ,
69
+ 'cr-combined-order-book--loading' : orderBookLoading ,
70
70
'pg-combined-order-book--no-data-first' : ( ! asks . length && ! isLarge ) || ( ! bids . length && isLarge ) ,
71
71
'pg-combined-order-book--no-data-second' : ( ! bids . length && ! isLarge ) || ( ! asks . length && isLarge ) ,
72
72
} ) ;
73
73
74
74
return (
75
75
< div className = { cn } ref = { this . orderRef } >
76
- { isLoading ? < div > < Loader /> </ div > : this . orderBook ( sortBids ( bids ) , sortAsks ( asks ) ) }
76
+ { orderBookLoading ? < div > < Loader /> </ div > : this . orderBook ( sortBids ( bids ) , sortAsks ( asks ) ) }
77
77
</ div >
78
78
) ;
79
79
}
@@ -188,10 +188,10 @@ class OrderBookContainer extends React.Component<Props, State> {
188
188
} ;
189
189
}
190
190
191
- const mapStateToProps : MapStateToProps < ReduxProps , { } , RootState > = state => ( {
191
+ const mapStateToProps = ( state : RootState ) => ( {
192
192
bids : selectDepthBids ( state ) ,
193
193
asks : selectDepthAsks ( state ) ,
194
- isLoading : selectDepthLoading ( state ) ,
194
+ orderBookLoading : selectDepthLoading ( state ) ,
195
195
currentMarket : selectCurrentMarket ( state ) ,
196
196
currentPrice : selectCurrentPrice ( state ) ,
197
197
marketTickers : selectMarketTickers ( state ) ,
0 commit comments