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 11import PropTypes from 'prop-types' ;
22import React from 'react' ;
3- import { connect } from 'react-redux' ;
3+ import { useSelector } from 'react-redux' ;
44import prettyBytes from 'pretty-bytes' ;
55
66import getConfig from '../../../utils/getConfig' ;
@@ -18,7 +18,11 @@ const formatPercent = (percent) => {
1818} ;
1919
2020/* 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+
2226 if ( totalSize === undefined ) {
2327 return null ;
2428 }
@@ -40,15 +44,4 @@ const AssetSize = ({ totalSize }) => {
4044 ) ;
4145} ;
4246
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