From c2f79128bd0797fed66f8c669e5912fce5d33098 Mon Sep 17 00:00:00 2001 From: Alejandro Cavallero Date: Mon, 21 May 2018 15:52:24 -0300 Subject: [PATCH] Add network unit to account balance on testnets (#1717) * Adding network unit to account balance * Shows network name only if it is testnet * Replacement of private function * Private function at the end --- common/components/BalanceSidebar/AccountInfo.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/components/BalanceSidebar/AccountInfo.tsx b/common/components/BalanceSidebar/AccountInfo.tsx index cd5d9855..f34ef62c 100644 --- a/common/components/BalanceSidebar/AccountInfo.tsx +++ b/common/components/BalanceSidebar/AccountInfo.tsx @@ -160,7 +160,7 @@ class AccountInfo extends React.Component { unit={'ether'} displayShortBalance={!showLongBalance} checkOffline={true} - symbol={balance.wei ? network.name : null} + symbol={balance.wei ? this.setSymbol(network) : null} /> {balance.wei && ( @@ -214,6 +214,13 @@ class AccountInfo extends React.Component { ); } + + private setSymbol(network: NetworkConfig) { + if (network.isTestnet) { + return network.unit + ' (' + network.name + ')'; + } + return network.unit; + } } function mapStateToProps(state: AppState): StateProps { return {