1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-02-10 23:22:40 +00:00

sort networks

This commit is contained in:
slowbackspace 2019-03-06 14:49:55 +01:00
parent cb89d0bbcf
commit 9a4edffa8c
3 changed files with 22 additions and 14 deletions

View File

@ -1,6 +1,7 @@
{ {
"networks": [ "networks": [
{ {
"order": 2,
"type": "ethereum", "type": "ethereum",
"name": "Ethereum", "name": "Ethereum",
"symbol": "ETH", "symbol": "ETH",
@ -21,6 +22,7 @@
} }
}, },
{ {
"order": 18,
"type": "ethereum", "type": "ethereum",
"name": "Ethereum Classic", "name": "Ethereum Classic",
"symbol": "ETC", "symbol": "ETC",
@ -41,6 +43,7 @@
} }
}, },
{ {
"order": 2,
"type": "ethereum", "type": "ethereum",
"name": "Ethereum Ropsten", "name": "Ethereum Ropsten",
"testnet": true, "testnet": true,
@ -74,6 +77,7 @@
} }
}, },
{ {
"order": 3,
"type": "ripple", "type": "ripple",
"name": "Ripple", "name": "Ripple",
"symbol": "XRP", "symbol": "XRP",
@ -94,6 +98,7 @@
} }
}, },
{ {
"order": 3,
"type": "ripple", "type": "ripple",
"name": "Ripple Testnet", "name": "Ripple Testnet",
"testnet": true, "testnet": true,

View File

@ -13,6 +13,7 @@ type NetworkFeeLevel = {
}; };
export type Network = { export type Network = {
order: number,
type: string, type: string,
name: string, name: string,
testnet?: boolean, testnet?: boolean,

View File

@ -75,7 +75,9 @@ class CoinMenu extends PureComponent<Props> {
const { config } = this.props.localStorage; const { config } = this.props.localStorage;
return ( return (
<Wrapper data-test="Main__page__coin__menu"> <Wrapper data-test="Main__page__coin__menu">
{config.networks.map(item => ( {config.networks
.sort((a, b) => a.order - b.order)
.map(item => (
<NavLink <NavLink
key={item.shortcut} key={item.shortcut}
to={`${this.getBaseUrl()}/network/${item.shortcut}/account/0`} to={`${this.getBaseUrl()}/network/${item.shortcut}/account/0`}