From 33cbd8025cf00c83e32ca9f89a726ea57ce1c4aa Mon Sep 17 00:00:00 2001 From: petitPapillon Date: Sat, 17 Jun 2017 21:08:50 +0200 Subject: [PATCH] Merge balance components - display walletsBalance in native mode --- react/src/components/dashboard/main/dashboard.js | 4 ++++ .../components/dashboard/main/dashboard.render.js | 2 +- .../dashboard/walletsBalance/walletsBalance.js | 15 ++++++++++++--- .../walletsBalance/walletsBalance.render.js | 3 ++- .../walletsNative/walletsNative.render.js | 5 +++-- .../walletsNativeBalance/walletsNativeBalance.js | 5 +++-- 6 files changed, 25 insertions(+), 9 deletions(-) diff --git a/react/src/components/dashboard/main/dashboard.js b/react/src/components/dashboard/main/dashboard.js index 3edd13b..8f9bdba 100755 --- a/react/src/components/dashboard/main/dashboard.js +++ b/react/src/components/dashboard/main/dashboard.js @@ -26,6 +26,10 @@ class Dashboard extends React.Component { this.props.Main.isLoggedIn; } + isNativeMode() { + return this.props.ActiveCoin.mode === 'native'; + } + render() { if (this.isLoggedIn()) { return this.renderDashboard(); diff --git a/react/src/components/dashboard/main/dashboard.render.js b/react/src/components/dashboard/main/dashboard.render.js index 32a36c9..3a18227 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() && } diff --git a/react/src/components/dashboard/walletsBalance/walletsBalance.js b/react/src/components/dashboard/walletsBalance/walletsBalance.js index f7784f6..89aac04 100755 --- a/react/src/components/dashboard/walletsBalance/walletsBalance.js +++ b/react/src/components/dashboard/walletsBalance/walletsBalance.js @@ -89,13 +89,22 @@ class WalletsBalance extends React.Component { ); } + isNativeMode() { + return this.isActiveCoinMode('native'); + } + render() { + console.log('wallets balance', this.props.ActiveCoin.nativeActiveSection, + (this.isNativeMode() && this.props.ActiveCoin.nativeActiveSection === 'default')); if (this.props && this.props.ActiveCoin && this.props.ActiveCoin.coin && - this.props.ActiveCoin.mode !== 'native' && - !this.props.ActiveCoin.send && - !this.props.ActiveCoin.receive) { + // this.props.ActiveCoin.mode !== 'native' && + ((this.isNativeMode() && this.props.ActiveCoin.nativeActiveSection === 'default') + || + (!this.isNativeMode() && !this.props.ActiveCoin.send &&!this.props.ActiveCoin.receive)) + ) + { return WalletsBalanceRender.call(this); } diff --git a/react/src/components/dashboard/walletsBalance/walletsBalance.render.js b/react/src/components/dashboard/walletsBalance/walletsBalance.render.js index c6aa2c3..276e40a 100644 --- a/react/src/components/dashboard/walletsBalance/walletsBalance.render.js +++ b/react/src/components/dashboard/walletsBalance/walletsBalance.render.js @@ -4,7 +4,7 @@ import { translate } from '../../../translate/translate'; const WalletsBalanceRender = function() { return (
-
+