Merge branch 'master' into rn738

This commit is contained in:
Marcos Rodriguez Velez 2024-05-26 12:53:16 -04:00
commit d1cc8a105c
No known key found for this signature in database
GPG key ID: 6030B2F48CCE86D7
5 changed files with 189 additions and 75 deletions

View file

@ -1,7 +1,13 @@
// https://levelup.gitconnected.com/debounce-in-javascript-improve-your-applications-performance-5b01855e086 // https://levelup.gitconnected.com/debounce-in-javascript-improve-your-applications-performance-5b01855e086
const debounce = <T extends (...args: any[]) => void>(func: T, wait: number) => { // blue_modules/debounce.ts
type DebouncedFunction<T extends (...args: any[]) => void> = {
(this: ThisParameterType<T>, ...args: Parameters<T>): void;
cancel(): void;
};
const debounce = <T extends (...args: any[]) => void>(func: T, wait: number): DebouncedFunction<T> => {
let timeout: NodeJS.Timeout | null; let timeout: NodeJS.Timeout | null;
return function executedFunction(this: ThisParameterType<T>, ...args: Parameters<T>) { const debouncedFunction = function (this: ThisParameterType<T>, ...args: Parameters<T>) {
const later = () => { const later = () => {
timeout = null; timeout = null;
func.apply(this, args); func.apply(this, args);
@ -11,6 +17,15 @@ const debounce = <T extends (...args: any[]) => void>(func: T, wait: number) =>
} }
timeout = setTimeout(later, wait); timeout = setTimeout(later, wait);
}; };
debouncedFunction.cancel = () => {
if (timeout) {
clearTimeout(timeout);
}
timeout = null;
};
return debouncedFunction as DebouncedFunction<T>;
}; };
export default debounce; export default debounce;

23
hooks/useDebounce.ts Normal file
View file

@ -0,0 +1,23 @@
import { useState, useEffect } from 'react';
import debounce from '../blue_modules/debounce';
const useDebounce = <T>(value: T, delay: number): T => {
const [debouncedValue, setDebouncedValue] = useState<T>(value);
useEffect(() => {
const handler = debounce((val: T) => {
setDebouncedValue(val);
}, delay);
handler(value);
return () => {
handler.cancel();
};
}, [value, delay]);
return debouncedValue;
};
export default useDebounce;

View file

@ -186,6 +186,7 @@ export type TFiatUnit = {
endPointKey: string; endPointKey: string;
symbol: string; symbol: string;
locale: string; locale: string;
country: string;
source: 'CoinDesk' | 'Yadio' | 'Exir' | 'wazirx' | 'Bitstamp' | 'Kraken'; source: 'CoinDesk' | 'Yadio' | 'Exir' | 'wazirx' | 'Bitstamp' | 'Kraken';
}; };
@ -199,6 +200,7 @@ export type FiatUnitType = {
endPointKey: string; endPointKey: string;
symbol: string; symbol: string;
locale: string; locale: string;
country: string;
source: keyof typeof FiatUnitSource; source: keyof typeof FiatUnitSource;
}; };

View file

@ -3,336 +3,392 @@
"endPointKey": "USD", "endPointKey": "USD",
"locale": "en-US", "locale": "en-US",
"source": "Kraken", "source": "Kraken",
"symbol": "$" "symbol": "$",
"country": "United States (US Dollar)"
}, },
"AED": { "AED": {
"endPointKey": "AED", "endPointKey": "AED",
"locale": "ar-AE", "locale": "ar-AE",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "د.إ." "symbol": "د.إ.",
"country": "United Arab Emirates (UAE Dirham)"
}, },
"ANG": { "ANG": {
"endPointKey": "ANG", "endPointKey": "ANG",
"locale": "en-SX", "locale": "en-SX",
"source": "CoinDesk", "source": "CoinDesk",
"symbol": "ƒ" "symbol": "ƒ",
"country": "Sint Maarten (Netherlands Antillean Guilder)"
}, },
"ARS": { "ARS": {
"endPointKey": "ARS", "endPointKey": "ARS",
"locale": "es-AR", "locale": "es-AR",
"source": "Yadio", "source": "Yadio",
"symbol": "$" "symbol": "$",
"country": "Argentina (Argentine Peso)"
}, },
"AUD": { "AUD": {
"endPointKey": "AUD", "endPointKey": "AUD",
"locale": "en-AU", "locale": "en-AU",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "$" "symbol": "$",
"country": "Australia (Australian Dollar)"
}, },
"AWG": { "AWG": {
"endPointKey": "AWG", "endPointKey": "AWG",
"locale": "nl-AW", "locale": "nl-AW",
"source": "CoinDesk", "source": "CoinDesk",
"symbol": "ƒ" "symbol": "ƒ",
"country": "Aruba (Aruban Florin)"
}, },
"BHD": { "BHD": {
"endPointKey": "BHD", "endPointKey": "BHD",
"locale": "ar-BH", "locale": "ar-BH",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "د.ب." "symbol": "د.ب.",
"country": "Bahrain (Bahraini Dinar)"
}, },
"BRL": { "BRL": {
"endPointKey": "BRL", "endPointKey": "BRL",
"locale": "pt-BR", "locale": "pt-BR",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "R$" "symbol": "R$",
"country": "Brazil (Brazilian Real)"
}, },
"CAD": { "CAD": {
"endPointKey": "CAD", "endPointKey": "CAD",
"locale": "en-CA", "locale": "en-CA",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "$" "symbol": "$",
"country": "Canada (Canadian Dollar)"
}, },
"CHF": { "CHF": {
"endPointKey": "CHF", "endPointKey": "CHF",
"locale": "de-CH", "locale": "de-CH",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "CHF" "symbol": "CHF",
"country": "Switzerland (Swiss Franc)"
}, },
"CLP": { "CLP": {
"endPointKey": "CLP", "endPointKey": "CLP",
"locale": "es-CL", "locale": "es-CL",
"source": "Yadio", "source": "Yadio",
"symbol": "$" "symbol": "$",
"country": "Chile (Chilean Peso)"
}, },
"CNY": { "CNY": {
"endPointKey": "CNY", "endPointKey": "CNY",
"locale": "zh-CN", "locale": "zh-CN",
"source": "Coinbase", "source": "Coinbase",
"symbol": "¥" "symbol": "¥",
"country": "China (Chinese Yuan)"
}, },
"COP": { "COP": {
"endPointKey": "COP", "endPointKey": "COP",
"locale": "es-CO", "locale": "es-CO",
"source": "CoinDesk", "source": "CoinDesk",
"symbol": "$" "symbol": "$",
"country": "Colombia (Colombian Peso)"
}, },
"CZK": { "CZK": {
"endPointKey": "CZK", "endPointKey": "CZK",
"locale": "cs-CZ", "locale": "cs-CZ",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "Kč" "symbol": "Kč",
"country": "Czech Republic (Czech Koruna)"
}, },
"DKK": { "DKK": {
"endPointKey": "DKK", "endPointKey": "DKK",
"locale": "da-DK", "locale": "da-DK",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "kr" "symbol": "kr",
"country": "Denmark (Danish Krone)"
}, },
"EUR": { "EUR": {
"endPointKey": "EUR", "endPointKey": "EUR",
"locale": "en-IE", "locale": "en-IE",
"source": "Kraken", "source": "Kraken",
"symbol": "€" "symbol": "€",
"country": "European Union (Euro)"
}, },
"GBP": { "GBP": {
"endPointKey": "GBP", "endPointKey": "GBP",
"locale": "en-GB", "locale": "en-GB",
"source": "Kraken", "source": "Kraken",
"symbol": "£" "symbol": "£",
"country": "United Kingdom (British Pound)"
}, },
"HRK": { "HRK": {
"endPointKey": "HRK", "endPointKey": "HRK",
"locale": "hr-HR", "locale": "hr-HR",
"source": "CoinDesk", "source": "CoinDesk",
"symbol": "HRK" "symbol": "HRK",
"country": "Croatia (Croatian Kuna)"
}, },
"HUF": { "HUF": {
"endPointKey": "HUF", "endPointKey": "HUF",
"locale": "hu-HU", "locale": "hu-HU",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "Ft" "symbol": "Ft",
"country": "Hungary (Hungarian Forint)"
}, },
"IDR": { "IDR": {
"endPointKey": "IDR", "endPointKey": "IDR",
"locale": "id-ID", "locale": "id-ID",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "Rp" "symbol": "Rp",
"country": "Indonesia (Indonesian Rupiah)"
}, },
"ILS": { "ILS": {
"endPointKey": "ILS", "endPointKey": "ILS",
"locale": "he-IL", "locale": "he-IL",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "₪" "symbol": "₪",
"country": "Israel (Israeli New Shekel)"
}, },
"INR": { "INR": {
"endPointKey": "INR", "endPointKey": "INR",
"locale": "hi-HN", "locale": "hi-IN",
"source": "wazirx", "source": "wazirx",
"symbol": "₹" "symbol": "₹",
"country": "India (Indian Rupee)"
}, },
"IRR": { "IRR": {
"endPointKey": "IRR", "endPointKey": "IRR",
"locale": "fa-IR", "locale": "fa-IR",
"source": "Exir", "source": "Exir",
"symbol": "﷼" "symbol": "﷼",
"country": "Iran (Iranian Rial)"
}, },
"IRT": { "IRT": {
"endPointKey": "IRT", "endPointKey": "IRT",
"locale": "fa-IR", "locale": "fa-IR",
"source": "Exir", "source": "Exir",
"symbol": "تومان" "symbol": "تومان",
"country": "Iran (Iranian Toman)"
}, },
"ISK": { "ISK": {
"endPointKey": "ISK", "endPointKey": "ISK",
"locale": "is-IS", "locale": "is-IS",
"source": "CoinDesk", "source": "CoinDesk",
"symbol": "kr" "symbol": "kr",
"country": "Iceland (Icelandic Króna)"
}, },
"JPY": { "JPY": {
"endPointKey": "JPY", "endPointKey": "JPY",
"locale": "ja-JP", "locale": "ja-JP",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "¥" "symbol": "¥",
"country": "Japan (Japanese Yen)"
}, },
"KES": { "KES": {
"endPointKey": "KES", "endPointKey": "KES",
"locale": "en-KE", "locale": "en-KE",
"source": "CoinDesk", "source": "CoinDesk",
"symbol": "Ksh" "symbol": "Ksh",
"country": "Kenya (Kenyan Shilling)"
}, },
"KRW": { "KRW": {
"endPointKey": "KRW", "endPointKey": "KRW",
"locale": "ko-KR", "locale": "ko-KR",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "₩" "symbol": "₩",
"country": "South Korea (South Korean Won)"
}, },
"KWD": { "KWD": {
"endPointKey": "KWD", "endPointKey": "KWD",
"locale": "ar-KW", "locale": "ar-KW",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "د.ك." "symbol": "د.ك.",
"country": "Kuwait (Kuwaiti Dinar)"
}, },
"LBP": { "LBP": {
"endPointKey": "LBP", "endPointKey": "LBP",
"locale": "ar-LB", "locale": "ar-LB",
"source": "YadioConvert", "source": "YadioConvert",
"symbol": "ل.ل." "symbol": "ل.ل.",
"country": "Lebanon (Lebanese Pound)"
}, },
"LKR": { "LKR": {
"endPointKey": "LKR", "endPointKey": "LKR",
"locale": "si-LK", "locale": "si-LK",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "රු." "symbol": "රු.",
"country": "Sri Lanka (Sri Lankan Rupee)"
}, },
"MXN": { "MXN": {
"endPointKey": "MXN", "endPointKey": "MXN",
"locale": "es-MX", "locale": "es-MX",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "$" "symbol": "$",
"country": "Mexico (Mexican Peso)"
}, },
"MYR": { "MYR": {
"endPointKey": "MYR", "endPointKey": "MYR",
"locale": "ms-MY", "locale": "ms-MY",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "RM" "symbol": "RM",
"country": "Malaysia (Malaysian Ringgit)"
}, },
"MZN": { "MZN": {
"endPointKey": "MZN", "endPointKey": "MZN",
"locale": "seh-MZ", "locale": "seh-MZ",
"source": "CoinDesk", "source": "CoinDesk",
"symbol": "MTn" "symbol": "MTn",
"country": "Mozambique (Mozambican Metical)"
}, },
"NGN": { "NGN": {
"endPointKey": "NGN", "endPointKey": "NGN",
"locale": "en-NG", "locale": "en-NG",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "₦" "symbol": "₦",
"country": "Nigeria (Nigerian Naira)"
}, },
"NOK": { "NOK": {
"endPointKey": "NOK", "endPointKey": "NOK",
"locale": "nb-NO", "locale": "nb-NO",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "kr" "symbol": "kr",
"country": "Norway (Norwegian Krone)"
}, },
"NZD": { "NZD": {
"endPointKey": "NZD", "endPointKey": "NZD",
"locale": "en-NZ", "locale": "en-NZ",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "$" "symbol": "$",
"country": "New Zealand (New Zealand Dollar)"
}, },
"OMR": { "OMR": {
"endPointKey": "OMR", "endPointKey": "OMR",
"locale": "ar-OM", "locale": "ar-OM",
"source": "CoinDesk", "source": "CoinDesk",
"symbol": "ر.ع." "symbol": "ر.ع.",
"country": "Oman (Omani Rial)"
}, },
"PHP": { "PHP": {
"endPointKey": "PHP", "endPointKey": "PHP",
"locale": "en-PH", "locale": "en-PH",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "₱" "symbol": "₱",
"country": "Philippines (Philippine Peso)"
}, },
"PLN": { "PLN": {
"endPointKey": "PLN", "endPointKey": "PLN",
"locale": "pl-PL", "locale": "pl-PL",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "zł" "symbol": "zł",
"country": "Poland (Polish Zloty)"
}, },
"QAR": { "QAR": {
"endPointKey": "QAR", "endPointKey": "QAR",
"locale": "ar-QA", "locale": "ar-QA",
"source": "CoinDesk", "source": "CoinDesk",
"symbol": "ر.ق." "symbol": "ر.ق.",
"country": "Qatar (Qatari Riyal)"
}, },
"RON": { "RON": {
"endPointKey": "RON", "endPointKey": "RON",
"locale": "ro-RO", "locale": "ro-RO",
"source": "BNR", "source": "BNR",
"symbol": "lei" "symbol": "lei",
"country": "Romania (Romanian Leu)"
}, },
"RUB": { "RUB": {
"endPointKey": "RUB", "endPointKey": "RUB",
"locale": "ru-RU", "locale": "ru-RU",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "₽" "symbol": "₽",
"country": "Russia (Russian Ruble)"
}, },
"SAR": { "SAR": {
"endPointKey": "SAR", "endPointKey": "SAR",
"locale": "ar-SA", "locale": "ar-SA",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "ر.س." "symbol": "ر.س.",
"country": "Saudi Arabia (Saudi Riyal)"
}, },
"SEK": { "SEK": {
"endPointKey": "SEK", "endPointKey": "SEK",
"locale": "sv-SE", "locale": "sv-SE",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "kr" "symbol": "kr",
"country": "Sweden (Swedish Krona)"
}, },
"SGD": { "SGD": {
"endPointKey": "SGD", "endPointKey": "SGD",
"locale": "zh-SG", "locale": "zh-SG",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "S$" "symbol": "S$",
"country": "Singapore (Singapore Dollar)"
}, },
"THB": { "THB": {
"endPointKey": "THB", "endPointKey": "THB",
"locale": "th-TH", "locale": "th-TH",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "฿" "symbol": "฿",
"country": "Thailand (Thai Baht)"
}, },
"TRY": { "TRY": {
"endPointKey": "TRY", "endPointKey": "TRY",
"locale": "tr-TR", "locale": "tr-TR",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "₺" "symbol": "₺",
"country": "Turkey (Turkish Lira)"
}, },
"TWD": { "TWD": {
"endPointKey": "TWD", "endPointKey": "TWD",
"locale": "zh-Hant-TW", "locale": "zh-Hant-TW",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "NT$" "symbol": "NT$",
"country": "Taiwan (New Taiwan Dollar)"
}, },
"TZS": { "TZS": {
"endPointKey": "TZS", "endPointKey": "TZS",
"locale": "en-TZ", "locale": "en-TZ",
"source": "CoinDesk", "source": "CoinDesk",
"symbol": "TSh" "symbol": "TSh",
"country": "Tanzania (Tanzanian Shilling)"
}, },
"UAH": { "UAH": {
"endPointKey": "UAH", "endPointKey": "UAH",
"locale": "uk-UA", "locale": "uk-UA",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "₴" "symbol": "₴",
"country": "Ukraine (Ukrainian Hryvnia)"
}, },
"UGX": { "UGX": {
"endPointKey": "UGX", "endPointKey": "UGX",
"locale": "en-UG", "locale": "en-UG",
"source": "CoinDesk", "source": "CoinDesk",
"symbol": "USh" "symbol": "USh",
"country": "Uganda (Ugandan Shilling)"
}, },
"UYU": { "UYU": {
"endPointKey": "UYU", "endPointKey": "UYU",
"locale": "es-UY", "locale": "es-UY",
"source": "CoinDesk", "source": "CoinDesk",
"symbol": "$" "symbol": "$",
"country": "Uruguay (Uruguayan Peso)"
}, },
"VEF": { "VEF": {
"endPointKey": "VEF", "endPointKey": "VEF",
"locale": "es-VE", "locale": "es-VE",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "Bs." "symbol": "Bs.",
"country": "Venezuela (Venezuelan Bolívar Fuerte)"
}, },
"VES": { "VES": {
"endPointKey": "VES", "endPointKey": "VES",
"locale": "es-VE", "locale": "es-VE",
"source": "Yadio", "source": "Yadio",
"symbol": "Bs." "symbol": "Bs.",
"country": "Venezuela (Venezuelan Bolívar Soberano)"
}, },
"ZAR": { "ZAR": {
"endPointKey": "ZAR", "endPointKey": "ZAR",
"locale": "en-ZA", "locale": "en-ZA",
"source": "CoinGecko", "source": "CoinGecko",
"symbol": "R" "symbol": "R",
"country": "South Africa (South African Rand)"
} }
} }

View file

@ -18,6 +18,7 @@ import { useTheme } from '../../components/themes';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation'; import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import loc from '../../loc'; import loc from '../../loc';
import { FiatUnit, FiatUnitSource, FiatUnitType, getFiatRate } from '../../models/fiatUnit'; import { FiatUnit, FiatUnitSource, FiatUnitType, getFiatRate } from '../../models/fiatUnit';
import useDebounce from '../../hooks/useDebounce';
dayjs.extend(calendar); dayjs.extend(calendar);
@ -26,13 +27,20 @@ const Currency: React.FC = () => {
const [isSavingNewPreferredCurrency, setIsSavingNewPreferredCurrency] = useState(false); const [isSavingNewPreferredCurrency, setIsSavingNewPreferredCurrency] = useState(false);
const [selectedCurrency, setSelectedCurrency] = useState<FiatUnitType>(FiatUnit.USD); const [selectedCurrency, setSelectedCurrency] = useState<FiatUnitType>(FiatUnit.USD);
const [currencyRate, setCurrencyRate] = useState<CurrencyRate>({ LastUpdated: null, Rate: null }); const [currencyRate, setCurrencyRate] = useState<CurrencyRate>({ LastUpdated: null, Rate: null });
const [isSearchFocused, setIsSearchFocused] = useState(false);
const { colors } = useTheme(); const { colors } = useTheme();
const { setOptions } = useExtendedNavigation(); const { setOptions } = useExtendedNavigation();
const [search, setSearch] = useState(''); const [search, setSearch] = useState('');
const debouncedSearch = useDebounce(search, 300);
const data = useMemo( const data = useMemo(
() => Object.values(FiatUnit).filter(item => item.endPointKey.toLowerCase().includes(search.toLowerCase())), () =>
[search], Object.values(FiatUnit).filter(
item =>
item.endPointKey.toLowerCase().includes(debouncedSearch.toLowerCase()) ||
item.country.toLowerCase().includes(debouncedSearch.toLowerCase()),
),
[debouncedSearch],
); );
const stylesHook = StyleSheet.create({ const stylesHook = StyleSheet.create({
@ -64,6 +72,8 @@ const Currency: React.FC = () => {
setOptions({ setOptions({
headerSearchBarOptions: { headerSearchBarOptions: {
onChangeText: (event: NativeSyntheticEvent<{ text: string }>) => setSearch(event.nativeEvent.text), onChangeText: (event: NativeSyntheticEvent<{ text: string }>) => setSearch(event.nativeEvent.text),
onFocus: () => setIsSearchFocused(true),
onBlur: () => setIsSearchFocused(false),
}, },
}); });
}, [setOptions]); }, [setOptions]);
@ -74,6 +84,7 @@ const Currency: React.FC = () => {
title={`${item.endPointKey} (${item.symbol})`} title={`${item.endPointKey} (${item.symbol})`}
containerStyle={StyleSheet.flatten([styles.flex, stylesHook.flex, { minHeight: 60 }])} containerStyle={StyleSheet.flatten([styles.flex, stylesHook.flex, { minHeight: 60 }])}
checkmark={selectedCurrency.endPointKey === item.endPointKey} checkmark={selectedCurrency.endPointKey === item.endPointKey}
subtitle={item.country}
onPress={async () => { onPress={async () => {
setIsSavingNewPreferredCurrency(true); setIsSavingNewPreferredCurrency(true);
try { try {
@ -86,7 +97,7 @@ const Currency: React.FC = () => {
} catch (error: any) { } catch (error: any) {
console.log(error); console.log(error);
presentAlert({ presentAlert({
message: error.message ? `${loc.settings.currency_fetch_error}: ${error.message}}` : loc.settings.currency_fetch_error, message: error.message ? `${loc.settings.currency_fetch_error}: ${error.message}` : loc.settings.currency_fetch_error,
}); });
} finally { } finally {
setIsSavingNewPreferredCurrency(false); setIsSavingNewPreferredCurrency(false);
@ -95,6 +106,11 @@ const Currency: React.FC = () => {
/> />
); );
const selectedCurrencyVisible = useMemo(
() => data.some(item => item.endPointKey === selectedCurrency.endPointKey),
[data, selectedCurrency],
);
return ( return (
<View style={[styles.flex, stylesHook.flex]}> <View style={[styles.flex, stylesHook.flex]}>
<FlatList <FlatList
@ -105,19 +121,21 @@ const Currency: React.FC = () => {
initialNumToRender={30} initialNumToRender={30}
renderItem={renderItem} renderItem={renderItem}
/> />
<BlueCard> {!isSearchFocused || selectedCurrencyVisible ? (
<BlueText> <BlueCard>
{loc.settings.currency_source} {selectedCurrency?.source ?? FiatUnitSource.CoinDesk} <BlueText>
</BlueText> {loc.settings.currency_source} {selectedCurrency?.source ?? FiatUnitSource.CoinDesk}
<BlueSpacing10 /> </BlueText>
<BlueText> <BlueSpacing10 />
{loc.settings.rate}: {currencyRate.Rate ?? loc._.never} <BlueText>
</BlueText> {loc.settings.rate}: {currencyRate.Rate ?? loc._.never}
<BlueSpacing10 /> </BlueText>
<BlueText> <BlueSpacing10 />
{loc.settings.last_updated}: {dayjs(currencyRate.LastUpdated).calendar() ?? loc._.never} <BlueText>
</BlueText> {loc.settings.last_updated}: {dayjs(currencyRate.LastUpdated).calendar() ?? loc._.never}
</BlueCard> </BlueText>
</BlueCard>
) : null}
</View> </View>
); );
}; };