add currency ordering
This commit is contained in:
parent
aeb32072ed
commit
5acc0a22a1
|
@ -19,7 +19,7 @@ import { updateStalePledges, getAndAddPledges } from './actions/pledges'
|
||||||
import { updateDelegates } from './actions/delegates'
|
import { updateDelegates } from './actions/delegates'
|
||||||
import { MySnackbarContentWrapper } from './components/base/SnackBars'
|
import { MySnackbarContentWrapper } from './components/base/SnackBars'
|
||||||
import { getUsdPrice, getPrices, generatePairKey } from './utils/prices'
|
import { getUsdPrice, getPrices, generatePairKey } from './utils/prices'
|
||||||
import { currencies } from './utils/currencies'
|
import { currencies, currencyOrder } from './utils/currencies'
|
||||||
import { uris } from './remote/graph'
|
import { uris } from './remote/graph'
|
||||||
import { getKyberCurrencies } from './remote/kyber'
|
import { getKyberCurrencies } from './remote/kyber'
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class App extends React.Component {
|
||||||
|
|
||||||
setCurrencies = async network => {
|
setCurrencies = async network => {
|
||||||
const kyberCurrencies = await getKyberCurrencies(network)
|
const kyberCurrencies = await getKyberCurrencies(network)
|
||||||
this.currencies = [...currencies, ...kyberCurrencies]
|
this.currencies = [...currencies, ...kyberCurrencies].sort(currencyOrder)
|
||||||
this.getAndSetPrices()
|
this.getAndSetPrices()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,3 +100,5 @@ export const generateHumanReadibleFn = decimals =>
|
||||||
export const generateChainReadibleFn = decimals =>
|
export const generateChainReadibleFn = decimals =>
|
||||||
num => (num * (10**decimals)).toString()
|
num => (num * (10**decimals)).toString()
|
||||||
|
|
||||||
|
const order = ['ETH', 'SNT'].reverse()
|
||||||
|
export const currencyOrder = (a, b) => order.indexOf(b.label) - order.indexOf(a.label)
|
||||||
|
|
Loading…
Reference in New Issue