mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 03:14:30 +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 [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);
|
||||||
|
@ -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);
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user