Browse Source

WalletsProgress prop refactor

all-modes
Miika Turunen 8 years ago
parent
commit
a22dc3b836
  1. 2
      react/src/components/dashboard/main/dashboard.render.js
  2. 20
      react/src/components/dashboard/walletsProgress/walletsProgress.js

2
react/src/components/dashboard/main/dashboard.render.js

@ -28,7 +28,7 @@ const DashboardRender = function() {
<div className={ this.isSectionActive('wallets') ? 'show' : 'hide' }> <div className={ this.isSectionActive('wallets') ? 'show' : 'hide' }>
<CoinTile /> <CoinTile />
<WalletsNav /> <WalletsNav />
{ !this.isNativeMode() && <WalletsProgress {...this.props} /> } { !this.isNativeMode() && <WalletsProgress /> }
{ !this.isNativeMode() && <WalletsBalance {...this.props} />} { !this.isNativeMode() && <WalletsBalance {...this.props} />}
<SendCoin {...this.props} /> <SendCoin {...this.props} />
{ !this.isNativeMode() && <ReceiveCoin {...this.props.ActiveCoin} /> } { !this.isNativeMode() && <ReceiveCoin {...this.props.ActiveCoin} /> }

20
react/src/components/dashboard/walletsProgress/walletsProgress.js

@ -1,4 +1,5 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { import {
SyncErrorLongestChainRender, SyncErrorLongestChainRender,
@ -12,8 +13,8 @@ import {
} from './walletsProgress.render'; } from './walletsProgress.render';
class WalletsProgress extends React.Component { class WalletsProgress extends React.Component {
constructor(props) { constructor() {
super(props); super();
this.isFullySynced = this.isFullySynced.bind(this); this.isFullySynced = this.isFullySynced.bind(this);
} }
@ -229,5 +230,18 @@ class WalletsProgress extends React.Component {
return null; return null;
} }
} }
const mapStateToProps = (state) => {
return {
Dashboard: state.Dashboard,
Settings: {
debugLog: state.Settings.debugLog,
},
ActiveCoin: {
mode: state.ActiveCoin.mode,
coin: state.coin,
}
};
};
export default WalletsProgress; export default connect(mapStateToProps)(WalletsProgress);
Loading…
Cancel
Save