From 37f1156856d6d1e669021523c39faaa51408db94 Mon Sep 17 00:00:00 2001 From: Illia Rudniev Date: Mon, 13 Jan 2025 15:43:46 +0200 Subject: [PATCH] fix: replaced source of country codes --- apps/kyb-app/src/helpers/countries-data.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/kyb-app/src/helpers/countries-data.ts b/apps/kyb-app/src/helpers/countries-data.ts index 9804b522a8..8b4b0c452d 100644 --- a/apps/kyb-app/src/helpers/countries-data.ts +++ b/apps/kyb-app/src/helpers/countries-data.ts @@ -1,9 +1,10 @@ +import { countryCodes } from '@ballerine/common'; +import { State } from 'country-state-city'; import isoCountries from 'i18n-iso-countries'; import enCountries from 'i18n-iso-countries/langs/en.json'; import cnCountries from 'i18n-iso-countries/langs/zh.json'; import nationalities from 'i18n-nationality'; import enNationalities from 'i18n-nationality/langs/en.json'; -import { State } from 'country-state-city'; import { TFunction } from 'i18next'; isoCountries.registerLocale(enCountries); @@ -21,11 +22,10 @@ const unsupportedNationalities = { export const getCountries = (lang = 'en') => { const language = languageConversionMap[lang as keyof typeof languageConversionMap] ?? lang; - const countries = isoCountries.getNames(language, { select: 'official' }); - return Object.entries(countries).map(([isoCode, title]) => ({ + return countryCodes.map(isoCode => ({ const: isoCode, - title, + title: isoCountries.getName(isoCode?.toLocaleUpperCase(), language), })); };