From a22dc3b836b6ef5028503fa70a546744405b493b Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Mon, 14 Aug 2017 01:10:09 +0300 Subject: [PATCH] WalletsProgress prop refactor --- .../dashboard/main/dashboard.render.js | 2 +- .../walletsProgress/walletsProgress.js | 20 ++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/react/src/components/dashboard/main/dashboard.render.js b/react/src/components/dashboard/main/dashboard.render.js index c5cd9c2..a63d4c7 100644 --- a/react/src/components/dashboard/main/dashboard.render.js +++ b/react/src/components/dashboard/main/dashboard.render.js @@ -28,7 +28,7 @@ const DashboardRender = function() {
- { !this.isNativeMode() && } + { !this.isNativeMode() && } { !this.isNativeMode() && } { !this.isNativeMode() && } diff --git a/react/src/components/dashboard/walletsProgress/walletsProgress.js b/react/src/components/dashboard/walletsProgress/walletsProgress.js index 1edbfec..6e9e1aa 100644 --- a/react/src/components/dashboard/walletsProgress/walletsProgress.js +++ b/react/src/components/dashboard/walletsProgress/walletsProgress.js @@ -1,4 +1,5 @@ import React from 'react'; +import { connect } from 'react-redux'; import { translate } from '../../../translate/translate'; import { SyncErrorLongestChainRender, @@ -12,8 +13,8 @@ import { } from './walletsProgress.render'; class WalletsProgress extends React.Component { - constructor(props) { - super(props); + constructor() { + super(); this.isFullySynced = this.isFullySynced.bind(this); } @@ -229,5 +230,18 @@ class WalletsProgress extends React.Component { 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); \ No newline at end of file