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