Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing currency conversions #1787

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ exports[`GeneralSettings should render correctly 1`] = `
onValueChange={[Function]}
options={
Array [
Object {
"key": "1st",
"label": "1ST - FirstBlood",
"value": "1st",
},
Object {
"key": "adt",
"label": "ADT - adToken",
Expand Down Expand Up @@ -192,6 +197,11 @@ exports[`GeneralSettings should render correctly 1`] = `
"label": "IDR - Indonesian Rupiah",
"value": "idr",
},
Object {
"key": "inr",
"label": "INR - Indian Rupee",
"value": "inr",
},
Object {
"key": "jpy",
"label": "JPY - Japanese Yen",
Expand Down Expand Up @@ -282,6 +292,11 @@ exports[`GeneralSettings should render correctly 1`] = `
"label": "RUB - Russian Ruble",
"value": "rub",
},
Object {
"key": "sai",
"label": "SAI - SAI",
"value": "sai",
},
Object {
"key": "sc",
"label": "SC - Siacoin",
Expand Down Expand Up @@ -327,6 +342,11 @@ exports[`GeneralSettings should render correctly 1`] = `
"label": "TRST - WeTrust",
"value": "trst",
},
Object {
"key": "uah",
"label": "UAH - Ukrainian Hryvnia",
"value": "uah",
},
Object {
"key": "usd",
"label": "USD - United States Dollar",
Expand Down
13 changes: 10 additions & 3 deletions app/components/Views/Settings/GeneralSettings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ import { getNavigationOptionsTitle } from '../../../UI/Navbar';
import { setSearchEngine, setPrimaryCurrency } from '../../../../actions/settings';
import PickComponent from '../../PickComponent';

const sortedCurrencies = infuraCurrencies.objects.sort((a, b) =>
a.quote.code.toLocaleLowerCase().localeCompare(b.quote.code.toLocaleLowerCase())
);
const sortedCurrencies = infuraCurrencies.objects
.map((value, index) =>
Object.assign({}, value, {
base: {
code: 'eth',
name: 'Ethereum'
}
})
)
.sort((a, b) => a.quote.code.toLocaleLowerCase().localeCompare(b.quote.code.toLocaleLowerCase()));

const infuraCurrencyOptions = sortedCurrencies.map(({ quote: { code, name } }) => ({
label: `${code.toUpperCase()} - ${name}`,
Expand Down
Loading