diff --git a/src/dapp.js b/src/dapp.js index 646ecd6..e40e47b 100644 --- a/src/dapp.js +++ b/src/dapp.js @@ -19,7 +19,7 @@ import { updateStalePledges, getAndAddPledges } from './actions/pledges' import { updateDelegates } from './actions/delegates' import { MySnackbarContentWrapper } from './components/base/SnackBars' import { getUsdPrice, getPrices, generatePairKey } from './utils/prices' -import { currencies } from './utils/currencies' +import { currencies, currencyOrder } from './utils/currencies' import { uris } from './remote/graph' import { getKyberCurrencies } from './remote/kyber' @@ -48,7 +48,7 @@ class App extends React.Component { setCurrencies = async network => { const kyberCurrencies = await getKyberCurrencies(network) - this.currencies = [...currencies, ...kyberCurrencies] + this.currencies = [...currencies, ...kyberCurrencies].sort(currencyOrder) this.getAndSetPrices() } diff --git a/src/utils/currencies.js b/src/utils/currencies.js index 0f95978..34029cf 100644 --- a/src/utils/currencies.js +++ b/src/utils/currencies.js @@ -100,3 +100,5 @@ export const generateHumanReadibleFn = decimals => export const generateChainReadibleFn = decimals => num => (num * (10**decimals)).toString() +const order = ['ETH', 'SNT'].reverse() +export const currencyOrder = (a, b) => order.indexOf(b.label) - order.indexOf(a.label)