refactor: simplify currentLocale determination in LanguageSwitcher component
This commit is contained in:
@@ -10,10 +10,7 @@ import LanguageOutlinedIcon from "@mui/icons-material/LanguageOutlined";
|
|||||||
const LanguageSwitcher = () => {
|
const LanguageSwitcher = () => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const appContext = useContext(AppContext);
|
const appContext = useContext(AppContext);
|
||||||
const currentLocale =
|
const currentLocale = appContext && appContext.locale === "en" ? "NL" : "EN";
|
||||||
appContext && appContext.locale
|
|
||||||
? String(appContext.locale).toUpperCase()
|
|
||||||
: "EN";
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
|||||||
Reference in New Issue
Block a user