From 651e03d16e0609ff57aafd41334feed3441288ba Mon Sep 17 00:00:00 2001 From: Jamie Guthrie Date: Sun, 20 Aug 2023 00:12:23 +0200 Subject: Use flags-library to work on Windows --- modern/src/common/components/LocalizationProvider.jsx | 3 --- modern/src/login/LoginPage.jsx | 9 +++++---- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'modern/src') 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 = () => {