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' ;
21import React from 'react' ;
3- import { connect } from 'react-redux' ;
2+ import { useSelector } from 'react-redux' ;
43import prettyBytes from 'pretty-bytes' ;
54
65import getConfig from '../../../utils/getConfig' ;
@@ -18,7 +17,11 @@ const formatPercent = (percent) => {
1817} ;
1918
2019/* 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+
2225 if ( totalSize === undefined ) {
2326 return null ;
2427 }
@@ -40,15 +43,4 @@ const AssetSize = ({ totalSize }) => {
4043 ) ;
4144} ;
4245
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