sort networks

pull/439/head
slowbackspace 5 years ago
parent cb89d0bbcf
commit 9a4edffa8c

@ -1,6 +1,7 @@
{
"networks": [
{
"order": 2,
"type": "ethereum",
"name": "Ethereum",
"symbol": "ETH",
@ -21,6 +22,7 @@
}
},
{
"order": 18,
"type": "ethereum",
"name": "Ethereum Classic",
"symbol": "ETC",
@ -40,7 +42,8 @@
"address": "https://gastracker.io/addr/"
}
},
{
{
"order": 2,
"type": "ethereum",
"name": "Ethereum Ropsten",
"testnet": true,
@ -74,6 +77,7 @@
}
},
{
"order": 3,
"type": "ripple",
"name": "Ripple",
"symbol": "XRP",
@ -94,6 +98,7 @@
}
},
{
"order": 3,
"type": "ripple",
"name": "Ripple Testnet",
"testnet": true,

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

@ -75,19 +75,21 @@ class CoinMenu extends PureComponent<Props> {
const { config } = this.props.localStorage;
return (
<Wrapper data-test="Main__page__coin__menu">
{config.networks.map(item => (
<NavLink
key={item.shortcut}
to={`${this.getBaseUrl()}/network/${item.shortcut}/account/0`}
>
<RowCoin
network={{
name: item.name,
shortcut: item.shortcut,
}}
/>
</NavLink>
))}
{config.networks
.sort((a, b) => a.order - b.order)
.map(item => (
<NavLink
key={item.shortcut}
to={`${this.getBaseUrl()}/network/${item.shortcut}/account/0`}
>
<RowCoin
network={{
name: item.name,
shortcut: item.shortcut,
}}
/>
</NavLink>
))}
<Divider
testId="Main__page__coin__menu__divider"
textLeft={<FormattedMessage {...l10nMessages.TR_OTHER_COINS} />}

Loading…
Cancel
Save