aboutsummaryrefslogtreecommitdiff
path: root/modern/src
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src')
-rw-r--r--modern/src/common/components/LocalizationProvider.jsx3
-rw-r--r--modern/src/login/LoginPage.jsx9
2 files changed, 5 insertions, 7 deletions
diff --git a/modern/src/common/components/LocalizationProvider.jsx b/modern/src/common/components/LocalizationProvider.jsx
index 1c87bc7d..2ace1e24 100644
--- a/modern/src/common/components/LocalizationProvider.jsx
+++ b/modern/src/common/components/LocalizationProvider.jsx
@@ -186,6 +186,3 @@ export const useTranslationKeys = (predicate) => {
const { data } = context.languages[context.language];
return Object.keys(data).filter(predicate);
};
-
-export const getFlagEmoji = (country) => String.fromCodePoint(...[...country].map(x=>0x1f1a5+x.charCodeAt()));
-
diff --git a/modern/src/login/LoginPage.jsx b/modern/src/login/LoginPage.jsx
index 5dcdbeb4..cdcd6df6 100644
--- a/modern/src/login/LoginPage.jsx
+++ b/modern/src/login/LoginPage.jsx
@@ -3,6 +3,7 @@ import moment from 'moment';
import {
useMediaQuery, InputLabel, Select, MenuItem, FormControl, Button, TextField, Link, Snackbar, IconButton, Tooltip, LinearProgress, Box,
} from '@mui/material';
+import ReactCountryFlag from 'react-country-flag';
import makeStyles from '@mui/styles/makeStyles';
import CloseIcon from '@mui/icons-material/Close';
import LockOpenIcon from '@mui/icons-material/LockOpen';
@@ -10,7 +11,7 @@ import { useTheme } from '@mui/material/styles';
import { useDispatch, useSelector } from 'react-redux';
import { useNavigate } from 'react-router-dom';
import { sessionActions } from '../store';
-import { useLocalization, useTranslation, getFlagEmoji } from '../common/components/LocalizationProvider';
+import { useLocalization, useTranslation } from '../common/components/LocalizationProvider';
import LoginLayout from './LoginLayout';
import usePersistedState from '../common/util/usePersistedState';
import { handleLoginTokenListeners, nativeEnvironment, nativePostMessage } from '../common/components/NativeInterface';
@@ -211,9 +212,9 @@ const LoginPage = () => {
<Select label={t('loginLanguage')} value={language} onChange={(e) => setLanguage(e.target.value)}>
{languageList.map((it) => (
<MenuItem key={it.code} value={it.code}>
- {navigator.platform.indexOf('Win') < 0 && (
- <Box component="span" sx={{ mr: 1 }}>{getFlagEmoji(it.country)}</Box>
- )}
+ <Box component="span" sx={{ mr: 1 }}>
+ <ReactCountryFlag countryCode={it.country} />
+ </Box>
{it.name}
</MenuItem>
))}