make international tel codes a static object

This commit is contained in:
Samuel Newman
2025-12-01 11:21:31 +02:00
parent 4c2bf531de
commit ec4d753643
2 changed files with 1518 additions and 1511 deletions
@@ -4,8 +4,8 @@ import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {
getCountriesWithTelephoneCodes,
getDefaultCountry,
INTERNATIONAL_TELEPHONE_CODES,
} from '#/lib/international-telephone-codes'
import {isWeb} from '#/platform/detection'
import {useGeolocationStatus} from '#/state/geolocation'
@@ -33,15 +33,13 @@ export function InternationalPhoneCodeSelect({
}, [location])
const items = useMemo(() => {
const telCountryMap = getCountriesWithTelephoneCodes(i18n)
return (
Object.entries(telCountryMap)
Object.entries(INTERNATIONAL_TELEPHONE_CODES)
.map(([value, {name, code, unicodeFlag, svgFlag}]) => ({
value,
name,
name: name(i18n),
code,
label: `${name} ${code}`,
label: `${name(i18n)} ${code}`,
unicodeFlag,
svgFlag,
}))
File diff suppressed because it is too large Load Diff