|
|
|
@ -212,28 +212,26 @@ class NetworkDropdown extends Component { |
|
|
|
|
getNetworkName() { |
|
|
|
|
const { provider } = this.props; |
|
|
|
|
const providerName = provider.type; |
|
|
|
|
const { t } = this.context; |
|
|
|
|
|
|
|
|
|
let name; |
|
|
|
|
|
|
|
|
|
if (providerName === 'mainnet') { |
|
|
|
|
name = this.context.t('mainnet'); |
|
|
|
|
} else if (providerName === 'ropsten') { |
|
|
|
|
name = this.context.t('ropsten'); |
|
|
|
|
} else if (providerName === 'kovan') { |
|
|
|
|
name = this.context.t('kovan'); |
|
|
|
|
} else if (providerName === 'rinkeby') { |
|
|
|
|
name = this.context.t('rinkeby'); |
|
|
|
|
} else if (providerName === 'goerli') { |
|
|
|
|
name = this.context.t('goerli'); |
|
|
|
|
} else if (providerName === 'sepolia') { |
|
|
|
|
name = this.context.t('sepolia'); |
|
|
|
|
} else if (providerName === 'localhost') { |
|
|
|
|
name = this.context.t('localhost'); |
|
|
|
|
} else { |
|
|
|
|
name = provider.nickname || this.context.t('unknownNetwork'); |
|
|
|
|
switch (providerName) { |
|
|
|
|
case NETWORK_TYPES.MAINNET: |
|
|
|
|
return t('mainnet'); |
|
|
|
|
case NETWORK_TYPES.ROPSTEN: |
|
|
|
|
return t('ropsten'); |
|
|
|
|
case NETWORK_TYPES.KOVAN: |
|
|
|
|
return t('kovan'); |
|
|
|
|
case NETWORK_TYPES.RINKEBY: |
|
|
|
|
return t('rinkeby'); |
|
|
|
|
case NETWORK_TYPES.GOERLI: |
|
|
|
|
return t('goerli'); |
|
|
|
|
case NETWORK_TYPES.SEPOLIA: |
|
|
|
|
return t('sepolia'); |
|
|
|
|
case NETWORK_TYPES.LOCALHOST: |
|
|
|
|
return t('localhost'); |
|
|
|
|
default: |
|
|
|
|
return provider.nickname || t('unknownNetwork'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return name; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
renderNetworkEntry(network) { |
|
|
|
@ -347,7 +345,7 @@ class NetworkDropdown extends Component { |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div className="network-dropdown-list"> |
|
|
|
|
{this.renderNetworkEntry('mainnet')} |
|
|
|
|
{this.renderNetworkEntry(NETWORK_TYPES.MAINNET)} |
|
|
|
|
|
|
|
|
|
{this.renderCustomRpcList( |
|
|
|
|
rpcListDetailWithoutLocalHost, |
|
|
|
@ -356,11 +354,11 @@ class NetworkDropdown extends Component { |
|
|
|
|
|
|
|
|
|
{shouldShowTestNetworks && ( |
|
|
|
|
<> |
|
|
|
|
{this.renderNetworkEntry('ropsten')} |
|
|
|
|
{this.renderNetworkEntry('kovan')} |
|
|
|
|
{this.renderNetworkEntry('rinkeby')} |
|
|
|
|
{this.renderNetworkEntry('goerli')} |
|
|
|
|
{this.renderNetworkEntry('sepolia')} |
|
|
|
|
{this.renderNetworkEntry(NETWORK_TYPES.ROPSTEN)} |
|
|
|
|
{this.renderNetworkEntry(NETWORK_TYPES.KOVAN)} |
|
|
|
|
{this.renderNetworkEntry(NETWORK_TYPES.RINKEBY)} |
|
|
|
|
{this.renderNetworkEntry(NETWORK_TYPES.GOERLI)} |
|
|
|
|
{this.renderNetworkEntry(NETWORK_TYPES.SEPOLIA)} |
|
|
|
|
{this.renderCustomRpcList( |
|
|
|
|
rpcListDetailForLocalHost, |
|
|
|
|
this.props.provider, |
|
|
|
|