Merge pull request #5096 from finned-palmer/show-dollar-sign-instead-of-USD

This commit is contained in:
L 2021-07-13 23:20:41 -05:00 committed by GitHub
commit 26ff3e279d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 6 deletions

View File

@ -24,11 +24,7 @@ const WalletModal = () => {
const [confirmingMasterTicket, setConfirmingMasterTicket] = useState(false); const [confirmingMasterTicket, setConfirmingMasterTicket] = useState(false);
const [error, setError] = useState(false); const [error, setError] = useState(false);
const checkTicket = ({ const checkTicket = ({ target: { value } }) => {
event: {
target: { value },
},
}) => {
// TODO: port over bridge ticket validation logic // TODO: port over bridge ticket validation logic
if (confirmingMasterTicket) { if (confirmingMasterTicket) {
setConfirmedMasterTicket(value); setConfirmedMasterTicket(value);

View File

@ -1,7 +1,7 @@
import React, { createContext, useContext, useEffect, useState } from 'react'; import React, { createContext, useContext, useEffect, useState } from 'react';
import _ from 'lodash'; import _ from 'lodash';
import { api } from '../api'; import { api } from '../api';
import { reduceHistory } from '../lib/util'; import { mapDenominationToSymbol, reduceHistory } from '../lib/util';
export const SettingsContext = createContext({ export const SettingsContext = createContext({
network: 'bitcoin', network: 'bitcoin',
@ -120,6 +120,7 @@ export const SettingsProvider = ({ channel, children }) => {
const newCurrencyRates = currencyRates; const newCurrencyRates = currencyRates;
for (let c in n) { for (let c in n) {
newCurrencyRates[c] = n[c]; newCurrencyRates[c] = n[c];
newCurrencyRates[c].symbol = mapDenominationToSymbol(c);
} }
setCurrencyRates(newCurrencyRates); setCurrencyRates(newCurrencyRates);
setTimeout(() => initializeCurrencyPoll(), 1000 * 60 * 15); setTimeout(() => initializeCurrencyPoll(), 1000 * 60 * 15);

View File

@ -118,3 +118,12 @@ export function reduceHistory(history) {
return hest2.recvd - hest1.recvd; return hest2.recvd - hest1.recvd;
}); });
} }
export function mapDenominationToSymbol(denomination) {
switch (denomination) {
case 'USD':
return '$';
default:
return denomination;
}
}