Skip to content

Commit

Permalink
chore: currency UI updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-wallet committed Sep 13, 2024
1 parent 9c21fd7 commit 1ebb5d2
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 4 deletions.
32 changes: 28 additions & 4 deletions packages/mobile/src/screens/setting/screens/currency/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const CurrencyScreen: FunctionComponent = observer(() => {
key,
label: priceStore.supportedVsCurrencies[key]?.currency.toUpperCase(),
symbol: priceStore.supportedVsCurrencies[key]?.symbol,
name: priceStore.supportedVsCurrencies[key]?.name,
};
});
}, [priceStore.supportedVsCurrencies]);
Expand All @@ -37,7 +38,7 @@ export const CurrencyScreen: FunctionComponent = observer(() => {
key={item.key}
style={
style.flatten(
["padding-18", "flex-row", "items-center", "justify-between"],
["padding-18", "flex-row", "justify-between", "items-center"],
[
item.key === priceStore.defaultVsCurrency &&
"background-color-indigo",
Expand All @@ -53,9 +54,32 @@ export const CurrencyScreen: FunctionComponent = observer(() => {
smartNavigation.goBack();
}}
>
<Text style={style.flatten(["body3", "color-white"]) as ViewStyle}>
{item.label} ({item.symbol})
</Text>
<View
style={
style.flatten([
"flex-1",
"flex-row",
"items-center",
]) as ViewStyle
}
>
<Text
style={style.flatten(["body3", "color-white"]) as ViewStyle}
>
{item.label}
</Text>
<Text
style={
style.flatten([
"body3",
"color-white@60%",
"margin-x-8",
]) as ViewStyle
}
>
{`${item.name} (${item.symbol})`}
</Text>
</View>
{item.key === priceStore.defaultVsCurrency ? <CheckIcon /> : null}
</RectButton>
);
Expand Down
46 changes: 46 additions & 0 deletions packages/mobile/src/stores/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,276 +268,322 @@ export class RootStore {
symbol: "$",
maxDecimals: 2,
locale: "en-US",
name: "United States Dollar",
},
aed: {
currency: "aed",
symbol: "د.إ",
maxDecimals: 2,
locale: "ar-AE",
name: "United Arab Emirates Dirham",
},
ars: {
currency: "ars",
symbol: "$",
maxDecimals: 2,
locale: "es-AR",
name: "Argentine Peso",
},
aud: {
currency: "aud",
symbol: "AU$",
maxDecimals: 2,
locale: "en-AU",
name: "Australian Dollar",
},
bdt: {
currency: "bdt",
symbol: "৳",
maxDecimals: 2,
locale: "bn-BD",
name: "Bangladeshi Taka",
},
bhd: {
currency: "bhd",
symbol: ".د.ب",
maxDecimals: 3,
locale: "ar-BH",
name: "Bahraini Dinar",
},
bmd: {
currency: "bmd",
symbol: "BD$",
maxDecimals: 2,
locale: "en-BM",
name: "Bermudian Dollar",
},
brl: {
currency: "brl",
symbol: "R$",
maxDecimals: 2,
locale: "pt-BR",
name: "Brazilian Real",
},
cad: {
currency: "cad",
symbol: "CA$",
maxDecimals: 2,
locale: "en-CA",
name: "Canadian Dollar",
},
chf: {
currency: "chf",
symbol: "CHF",
maxDecimals: 2,
locale: "de-CH",
name: "Swiss Franc",
},
clp: {
currency: "clp",
symbol: "$",
maxDecimals: 2,
locale: "es-CL",
name: "Chilean Peso",
},
cny: {
currency: "cny",
symbol: "¥",
maxDecimals: 1,
locale: "zh-CN",
name: "Chinese Yuan",
},
czk: {
currency: "czk",
symbol: "Kč",
maxDecimals: 2,
locale: "cs-CZ",
name: "Czech Koruna",
},
dkk: {
currency: "dkk",
symbol: "kr",
maxDecimals: 2,
locale: "da-DK",
name: "Danish Krone",
},
eur: {
currency: "eur",
symbol: "€",
maxDecimals: 2,
locale: "en-IE",
name: "Euro",
},
gbp: {
currency: "gbp",
symbol: "£",
maxDecimals: 2,
locale: "en-GB",
name: "British Pound Sterling",
},
gel: {
currency: "gel",
symbol: "₾",
maxDecimals: 2,
locale: "ka-GE",
name: "Georgian Lari",
},
hkd: {
currency: "hkd",
symbol: "HK$",
maxDecimals: 1,
locale: "en-HK",
name: "Hong Kong Dollar",
},
huf: {
currency: "huf",
symbol: "Ft",
maxDecimals: 2,
locale: "hu-HU",
name: "Hungarian Forint",
},
idr: {
currency: "idr",
symbol: "Rp",
maxDecimals: 2,
locale: "id-ID",
name: "Indonesian Rupiah",
},
ils: {
currency: "ils",
symbol: "₪",
maxDecimals: 2,
locale: "he-IL",
name: "Israeli New Shekel",
},
inr: {
currency: "inr",
symbol: "₹",
maxDecimals: 1,
locale: "en-IN",
name: "Indian Rupee",
},
jpy: {
currency: "jpy",
symbol: "¥",
maxDecimals: 2,
locale: "ja-JP",
name: "Japanese Yen",
},
krw: {
currency: "krw",
symbol: "₩",
maxDecimals: 2,
locale: "ko-KR",
name: "South Korean Won",
},
kwd: {
currency: "kwd",
symbol: "د.ك",
maxDecimals: 3,
locale: "ar-KW",
name: "Kuwaiti Dinar",
},
lkr: {
currency: "lkr",
symbol: "Rs",
maxDecimals: 2,
locale: "si-LK",
name: "Sri Lankan Rupee",
},
mmk: {
currency: "mmk",
symbol: "K",
maxDecimals: 0,
locale: "my-MM",
name: "Myanmar Kyat",
},
mxn: {
currency: "mxn",
symbol: "MX$",
maxDecimals: 2,
locale: "es-MX",
name: "Mexican Peso",
},
myr: {
currency: "myr",
symbol: "RM",
maxDecimals: 2,
locale: "ms-MY",
name: "Malaysian Ringgit",
},
ngn: {
currency: "ngn",
symbol: "₦",
maxDecimals: 2,
locale: "en-NG",
name: "Nigerian Naira",
},
nok: {
currency: "nok",
symbol: "kr",
maxDecimals: 2,
locale: "nb-NO",
name: "Norwegian Krone",
},
nzd: {
currency: "nzd",
symbol: "NZ$",
maxDecimals: 2,
locale: "en-NZ",
name: "New Zealand Dollar",
},
php: {
currency: "php",
symbol: "₱",
maxDecimals: 2,
locale: "en-PH",
name: "Philippine Peso",
},
pkr: {
currency: "pkr",
symbol: "₨",
maxDecimals: 2,
locale: "en-PK",
name: "Pakistani Rupee",
},
pln: {
currency: "pln",
symbol: "zł",
maxDecimals: 2,
locale: "pl-PL",
name: "Polish Zloty",
},
rub: {
currency: "rub",
symbol: "₽",
maxDecimals: 2,
locale: "ru-RU",
name: "Russian Ruble",
},
sar: {
currency: "sar",
symbol: "ر.س",
maxDecimals: 2,
locale: "ar-SA",
name: "Saudi Riyal",
},
sek: {
currency: "sek",
symbol: "kr",
maxDecimals: 2,
locale: "sv-SE",
name: "Swedish Krona",
},
sgd: {
currency: "sgd",
symbol: "S$",
maxDecimals: 2,
locale: "en-SG",
name: "Singapore Dollar",
},
thb: {
currency: "thb",
symbol: "฿",
maxDecimals: 2,
locale: "th-TH",
name: "Thai Baht",
},
try: {
currency: "try",
symbol: "₺",
maxDecimals: 2,
locale: "tr-TR",
name: "Turkish Lira",
},
twd: {
currency: "twd",
symbol: "NT$",
maxDecimals: 2,
locale: "zh-TW",
name: "New Taiwan Dollar",
},
uah: {
currency: "uah",
symbol: "₴",
maxDecimals: 2,
locale: "uk-UA",
name: "Ukrainian Hryvnia",
},
vef: {
currency: "vef",
symbol: "Bs",
maxDecimals: 2,
locale: "es-VE",
name: "Venezuelan Bolívar",
},
vnd: {
currency: "vnd",
symbol: "₫",
maxDecimals: 2,
locale: "vi-VN",
name: "Vietnamese Dong",
},
zar: {
currency: "zar",
symbol: "R",
maxDecimals: 2,
locale: "en-ZA",
name: "South African Rand",
},
},
"usd"
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export interface FiatCurrency {
readonly symbol: string;
readonly maxDecimals: number;
readonly locale: string;
readonly name?: string;
}

export type WithGasPriceStep<T> = T & {
Expand Down

0 comments on commit 1ebb5d2

Please sign in to comment.