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
This commit is contained in:
Alejandro Cavallero 2018-05-21 15:52:24 -03:00 committed by Daniel Ternyak
parent b40c2a9508
commit c2f79128bd
1 changed files with 8 additions and 1 deletions

View File

@ -160,7 +160,7 @@ class AccountInfo extends React.Component<Props, State> {
unit={'ether'}
displayShortBalance={!showLongBalance}
checkOffline={true}
symbol={balance.wei ? network.name : null}
symbol={balance.wei ? this.setSymbol(network) : null}
/>
</span>
{balance.wei && (
@ -214,6 +214,13 @@ class AccountInfo extends React.Component<Props, State> {
</div>
);
}
private setSymbol(network: NetworkConfig) {
if (network.isTestnet) {
return network.unit + ' (' + network.name + ')';
}
return network.unit;
}
}
function mapStateToProps(state: AppState): StateProps {
return {