diff --git a/react/src/components/dashboard/walletsBalance/walletsBalance.js b/react/src/components/dashboard/walletsBalance/walletsBalance.js index 89aac04..b334d11 100755 --- a/react/src/components/dashboard/walletsBalance/walletsBalance.js +++ b/react/src/components/dashboard/walletsBalance/walletsBalance.js @@ -74,8 +74,12 @@ class WalletsBalance extends React.Component { return this.props.ActiveCoin.mode === coinMode; } - isNativeOrBasiliskCoinMode() { - return this.isActiveCoinMode('native') || this.isActiveCoinMode('basilisk'); + isBasiliskMode() { + return this.isActiveCoinMode('basilisk'); + } + + isFullMode() { + return this.isActiveCoinMode('full'); } renderLB(_translationID) { @@ -93,17 +97,20 @@ class WalletsBalance extends React.Component { return this.isActiveCoinMode('native'); } + isNativeBalanceActive() { + return this.isNativeMode() && this.props.ActiveCoin.nativeActiveSection === 'default'; + } + + isNonNativeBalanceActive() { + return !this.isNativeMode() && !this.props.ActiveCoin.send && !this.props.ActiveCoin.receive; + } + 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.isNativeMode() && this.props.ActiveCoin.nativeActiveSection === 'default') - || - (!this.isNativeMode() && !this.props.ActiveCoin.send &&!this.props.ActiveCoin.receive)) - ) + // TODO the conditions below should be merged when native mode is fully merge into the rest of the components + (this.isNativeBalanceActive() || this.isNonNativeBalanceActive())) { 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 276e40a..8fad139 100644 --- a/react/src/components/dashboard/walletsBalance/walletsBalance.render.js +++ b/react/src/components/dashboard/walletsBalance/walletsBalance.render.js @@ -1,11 +1,12 @@ -import React from 'react'; -import { translate } from '../../../translate/translate'; +import React from "react"; +import {translate} from "../../../translate/translate"; -const WalletsBalanceRender = function() { +const WalletsBalanceRender = function () { return (
-
-
+
+
-
+
@@ -39,10 +41,16 @@ const WalletsBalanceRender = function() {
- { translate('INDEX.BALANCE')} + { this.isNativeMode() ? translate('INDEX.TRANSPARENT_BALANCE') : translate('INDEX.BALANCE') }
- { this.renderBalance('main') } { this.props.ActiveCoin.coin } + { this.isNativeMode() ? + this.props.ActiveCoin.balance.transparent ? this.props.ActiveCoin.balance.transparent : '-' + : + + { this.renderBalance('main') } { this.props.ActiveCoin.coin } + + }
@@ -50,7 +58,26 @@ const WalletsBalanceRender = function() {
-
+ { this.isNativeMode() && +
+
+
+
+
+ + { translate('INDEX.Z_BALANCE') } +
+ + { this.props.ActiveCoin.balance.private ? this.props.ActiveCoin.balance.private : '-' } + +
+
+
+
+ } + +
@@ -60,7 +87,14 @@ const WalletsBalanceRender = function() { { translate('INDEX.INTEREST_EARNED') }
- { this.renderBalance('interest') } { this.props.ActiveCoin.coin } + { this.isNativeMode() ? + this.props.Dashboard.progress + && this.props.Dashboard.progress.interest ? this.props.Dashboard.progress.interest : '-' + : + + {this.renderBalance('interest')} {this.props.ActiveCoin.coin} + + }
@@ -68,7 +102,8 @@ const WalletsBalanceRender = function() {
-
+
@@ -78,7 +113,13 @@ const WalletsBalanceRender = function() { { translate('INDEX.TOTAL_BALANCE') }
- { this.renderBalance('total') } { this.props.ActiveCoin.coin } + { this.isNativeMode() ? + this.props.ActiveCoin.balance.total ? this.props.ActiveCoin.balance.total : '-' + : + + { this.renderBalance('total') } { this.props.ActiveCoin.coin } + + }
diff --git a/react/src/components/dashboard/walletsNativeBalance/walletsNativeBalance.js b/react/src/components/dashboard/walletsNativeBalance/walletsNativeBalance.js deleted file mode 100644 index 90f4634..0000000 --- a/react/src/components/dashboard/walletsNativeBalance/walletsNativeBalance.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import WalletsNativeBalanceRender from './walletsNativeBalance.render'; - -class WalletsNativeBalance extends React.Component { - render() { - if (false) { - // if (this.props && - // this.props.ActiveCoin.nativeActiveSection === 'default') { - return WalletsNativeBalanceRender.call(this); - } - - return null; - } -} - -export default WalletsNativeBalance; diff --git a/react/src/components/dashboard/walletsNativeBalance/walletsNativeBalance.render.js b/react/src/components/dashboard/walletsNativeBalance/walletsNativeBalance.render.js deleted file mode 100644 index a4c0844..0000000 --- a/react/src/components/dashboard/walletsNativeBalance/walletsNativeBalance.render.js +++ /dev/null @@ -1,82 +0,0 @@ -import React from 'react'; -import { translate } from '../../../translate/translate'; - -const WalletsNativeBalanceRender = function() { - return ( -
-
-
-
-
-
-
- - { translate('INDEX.TRANSPARENT_BALANCE') } -
- - { this.props.ActiveCoin.balance.transparent ? this.props.ActiveCoin.balance.transparent : '-' } - -
-
-
-
-
- -
-
-
-
-
-
- - { translate('INDEX.Z_BALANCE') } -
- - { this.props.ActiveCoin.balance.private ? this.props.ActiveCoin.balance.private : '-' } - -
-
-
-
-
- -
-
-
-
-
-
- - { translate('INDEX.INTEREST_EARNED') } -
- - { this.props.Dashboard.progress && this.props.Dashboard.progress.interest ? this.props.Dashboard.progress.interest : '-' } - -
-
-
-
-
- -
-
-
-
-
-
- - { translate('INDEX.ZT_BALANCE') } -
- - { this.props.ActiveCoin.balance.total ? this.props.ActiveCoin.balance.total : '-' } - -
-
-
-
-
-
- ); -}; - -export default WalletsNativeBalanceRender; \ No newline at end of file