mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 16:51:42 +03:00
Map dollar sign to USD
This commit is contained in:
parent
031d9d5a7d
commit
6bc8d247bd
@ -1,7 +1,7 @@
|
||||
import React, { createContext, useContext, useEffect, useState } from 'react';
|
||||
import _ from 'lodash';
|
||||
import { api } from '../api';
|
||||
import { reduceHistory } from '../lib/util';
|
||||
import { mapDenominationToSymbol, reduceHistory } from '../lib/util';
|
||||
|
||||
export const SettingsContext = createContext({
|
||||
network: 'bitcoin',
|
||||
@ -120,6 +120,7 @@ export const SettingsProvider = ({ channel, children }) => {
|
||||
const newCurrencyRates = currencyRates;
|
||||
for (let c in n) {
|
||||
newCurrencyRates[c] = n[c];
|
||||
newCurrencyRates[c].symbol = mapDenominationToSymbol(c);
|
||||
}
|
||||
setCurrencyRates(newCurrencyRates);
|
||||
setTimeout(() => initializeCurrencyPoll(), 1000 * 60 * 15);
|
||||
|
@ -118,3 +118,12 @@ export function reduceHistory(history) {
|
||||
return hest2.recvd - hest1.recvd;
|
||||
});
|
||||
}
|
||||
|
||||
export function mapDenominationToSymbol(denomination) {
|
||||
switch (denomination) {
|
||||
case 'USD':
|
||||
return '$';
|
||||
default:
|
||||
return denomination;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user