mirror of
https://github.com/urbit/shrub.git
synced 2024-12-23 19:05:48 +03:00
Merge pull request #5096 from finned-palmer/show-dollar-sign-instead-of-USD
This commit is contained in:
commit
26ff3e279d
@ -24,11 +24,7 @@ const WalletModal = () => {
|
||||
const [confirmingMasterTicket, setConfirmingMasterTicket] = useState(false);
|
||||
const [error, setError] = useState(false);
|
||||
|
||||
const checkTicket = ({
|
||||
event: {
|
||||
target: { value },
|
||||
},
|
||||
}) => {
|
||||
const checkTicket = ({ target: { value } }) => {
|
||||
// TODO: port over bridge ticket validation logic
|
||||
if (confirmingMasterTicket) {
|
||||
setConfirmedMasterTicket(value);
|
||||
|
@ -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