From 8923219384478d178ce37315cdc577a8644055e7 Mon Sep 17 00:00:00 2001 From: Miika Turunen Date: Thu, 17 Aug 2017 00:16:34 +0300 Subject: [PATCH] Jumblr prop refactor --- react/src/components/dashboard/jumblr/jumblr.js | 16 +++++++++++++--- .../components/dashboard/jumblr/jumblr.render.js | 2 -- .../dashboard/main/dashboard.render.js | 4 ++-- react/src/components/dashboard/navbar/navbar.js | 4 ++++ .../walletsNativeSend/walletsNativeSend.js | 7 +++---- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/react/src/components/dashboard/jumblr/jumblr.js b/react/src/components/dashboard/jumblr/jumblr.js index a69dbd1..d5d1582 100755 --- a/react/src/components/dashboard/jumblr/jumblr.js +++ b/react/src/components/dashboard/jumblr/jumblr.js @@ -1,4 +1,5 @@ import React from 'react'; +import { connect } from 'react-redux'; import { translate } from '../../../translate/translate'; import { dashboardChangeActiveCoin, @@ -39,8 +40,8 @@ if (!window.jumblrPasshrase) { // gen jumblr passphrase } class Jumblr extends React.Component { - constructor(props) { - super(props); + constructor() { + super(); this.state = { activeTab: 0, randomSeed: window.jumblrPasshrase, @@ -418,4 +419,13 @@ class Jumblr extends React.Component { } } -export default Jumblr; +const mapStateToProps = (state) => { + return { + ActiveCoin: { + coin: state.ActiveCoin.coin, + } + }; + +}; + +export default connect(mapStateToProps)(Jumblr); diff --git a/react/src/components/dashboard/jumblr/jumblr.render.js b/react/src/components/dashboard/jumblr/jumblr.render.js index fe060f7..cd8718b 100644 --- a/react/src/components/dashboard/jumblr/jumblr.render.js +++ b/react/src/components/dashboard/jumblr/jumblr.render.js @@ -369,7 +369,6 @@ export const JumblrRender = function() {

Use the form below to send funds to your jumblr deposit address.

You can also send funds to deposit address from an external service or another wallet.

@@ -475,7 +474,6 @@ export const JumblrRender = function() {
diff --git a/react/src/components/dashboard/main/dashboard.render.js b/react/src/components/dashboard/main/dashboard.render.js index c6b2026..66f3891 100644 --- a/react/src/components/dashboard/main/dashboard.render.js +++ b/react/src/components/dashboard/main/dashboard.render.js @@ -40,10 +40,10 @@ const DashboardRender = function() { } { this.isSectionActive('atomic') && - + } { this.isSectionActive('jumblr') && - + } { this.isSectionActive('settings') && diff --git a/react/src/components/dashboard/navbar/navbar.js b/react/src/components/dashboard/navbar/navbar.js index 63de947..c4adac0 100755 --- a/react/src/components/dashboard/navbar/navbar.js +++ b/react/src/components/dashboard/navbar/navbar.js @@ -117,6 +117,10 @@ class Navbar extends React.Component { } const mapStateToProps = (state) => { return { + ActiveCoin: { + mode: state.ActiveCoin.mode, + coin: state.ActiveCoin.coin, + }, Dashboard: { activeSection: state.Dashboard.activeSection, }, diff --git a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js index 6af8ce0..96178fc 100644 --- a/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js +++ b/react/src/components/dashboard/walletsNativeSend/walletsNativeSend.js @@ -19,8 +19,8 @@ import { } from './walletsNativeSend.render'; class WalletsNativeSend extends React.Component { - constructor() { - super(); + constructor(props) { + super(props); this.state = { addressType: null, sendFrom: null, @@ -368,8 +368,7 @@ const mapStateToProps = (state) => { mode: state.ActiveCoin.mode, opids: state.ActiveCoin.opids, activeSection: state.ActiveCoin.activeSection, - }, - renderFormOnly: state.renderFormOnly + } }; };