diff --git a/package.json b/package.json index c57cf4c88..e9750de18 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "axios": "^0.27.2", "consola": "^2.15.3", "cookies-next": "^2.1.1", + "country-flag-icons": "^1.5.5", "dayjs": "^1.11.5", "dockerode": "^3.3.2", "embla-carousel-react": "^7.0.0", diff --git a/public/imgs/flags/de.png b/public/imgs/flags/de.png deleted file mode 100644 index c62776bf3..000000000 Binary files a/public/imgs/flags/de.png and /dev/null differ diff --git a/public/imgs/flags/en.png b/public/imgs/flags/en.png deleted file mode 100644 index e6a6dc8be..000000000 Binary files a/public/imgs/flags/en.png and /dev/null differ diff --git a/src/components/Settings/LanguageSwitch.tsx b/src/components/Settings/LanguageSwitch.tsx index 22b6485c2..03a8d1dae 100644 --- a/src/components/Settings/LanguageSwitch.tsx +++ b/src/components/Settings/LanguageSwitch.tsx @@ -1,5 +1,6 @@ -import { Group, Image, Select, Stack, Text } from '@mantine/core'; +import { Group, Select, Stack, Text } from '@mantine/core'; import { showNotification } from '@mantine/notifications'; +import getUnicodeFlagIcon from 'country-flag-icons/unicode'; import { forwardRef, useState } from 'react'; import { useTranslation } from 'next-i18next'; @@ -20,7 +21,7 @@ export default function LanguageSwitch() { ? locales.map((localeItem) => ({ value: localeItem, label: getLanguageByCode(localeItem).originalName, - image: `imgs/flags/${localeItem}.png`, + icon: getUnicodeFlagIcon(localeItem), language: getLanguageByCode(localeItem), })) : []; @@ -56,20 +57,7 @@ export default function LanguageSwitch() { return (