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:
parent
b40c2a9508
commit
c2f79128bd
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue