Merge branch 'dev' into os-names

This commit is contained in:
Mike Cao 2024-02-14 22:15:08 -08:00 committed by GitHub
commit 37e28bbf74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
472 changed files with 5460 additions and 5026 deletions

View file

@ -2,7 +2,7 @@ import useMessages from './useMessages';
import { BROWSERS, OS_NAMES } from 'lib/constants';
import useLocale from './useLocale';
import useCountryNames from './useCountryNames';
import regions from 'public/iso-3166-2.json';
import regions from '../../../public/iso-3166-2.json';
export function useFormat() {
const { formatMessage, labels } = useMessages();
@ -31,7 +31,7 @@ export function useFormat() {
};
const formatCity = (value: string, country?: string): string => {
return `${value}, ${countryNames[country]}`;
return countryNames[country] ? `${value}, ${countryNames[country]}` : value;
};
const formatValue = (value: string, type: string, data?: { [key: string]: any }): string => {