How to use the react-native-localize.getCurrencies function in react-native-localize

To help you get started, we’ve selected a few react-native-localize examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-native-community / react-native-localize / example / src / AsyncExample.js View on Github external
render() {
    if (!this.state.isTranslationLoaded) {
      return ;
    }

    return (
github celo-org / celo-monorepo / packages / mobile / src / localCurrency / selectors.ts View on Github external
function findBestAvailableCurrency(supportedCurrencyCodes: LocalCurrencyCode[]) {
  const deviceCurrencies = RNLocalize.getCurrencies()
  const supportedCurrenciesSet = new Set(supportedCurrencyCodes)

  for (const deviceCurrency of deviceCurrencies) {
    if (supportedCurrenciesSet.has(deviceCurrency as LocalCurrencyCode)) {
      return deviceCurrency as LocalCurrencyCode
    }
  }

  return null
}
github OriginProtocol / origin / mobile / src / utils / currencies.js View on Github external
export function findBestAvailableCurrency() {
  const supportedCurrencyCodes = CURRENCIES.map(currency => currency.code)
  const preferredCurrencyCodes = RNLocalize.getCurrencies().filter(code =>
    supportedCurrencyCodes.includes(code)
  )
  const currencyCode = preferredCurrencyCodes.length
    ? preferredCurrencyCodes[0]
    : 'USD'
  return CURRENCIES.find(currency => currency.code === currencyCode)
}