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