File tree Expand file tree Collapse file tree 1 file changed +7
-14
lines changed
client/modules/IDE/components Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Original file line number Diff line number Diff line change 1
1
import PropTypes from 'prop-types' ;
2
2
import React from 'react' ;
3
- import { connect } from 'react-redux' ;
3
+ import { useSelector } from 'react-redux' ;
4
4
import prettyBytes from 'pretty-bytes' ;
5
5
6
6
import getConfig from '../../../utils/getConfig' ;
@@ -18,7 +18,11 @@ const formatPercent = (percent) => {
18
18
} ;
19
19
20
20
/* Eventually, this copy should be Total / 250 MB Used */
21
- const AssetSize = ( { totalSize } ) => {
21
+ const AssetSize = ( ) => {
22
+ const totalSize = useSelector (
23
+ ( state ) => state . user . totalSize || state . assets . totalSize
24
+ ) ;
25
+
22
26
if ( totalSize === undefined ) {
23
27
return null ;
24
28
}
@@ -40,15 +44,4 @@ const AssetSize = ({ totalSize }) => {
40
44
) ;
41
45
} ;
42
46
43
- AssetSize . propTypes = {
44
- totalSize : PropTypes . number . isRequired
45
- } ;
46
-
47
- function mapStateToProps ( state ) {
48
- return {
49
- user : state . user ,
50
- totalSize : state . user . totalSize || state . assets . totalSize
51
- } ;
52
- }
53
-
54
- export default connect ( mapStateToProps ) ( AssetSize ) ;
47
+ export default AssetSize ;
You can’t perform that action at this time.
0 commit comments