From 78c68efc004adf274892fa18ad8f7ef60fc42a91 Mon Sep 17 00:00:00 2001 From: Dan Dobos Date: Mon, 20 Oct 2025 21:05:39 +0200 Subject: [PATCH] refactor: enhance LanguageSwitcher component with tooltip for current locale --- .../languageSwitcher/LanguageSwitcher.jsx | 52 ++++++++++++------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/src/layouts/common/languageSwitcher/LanguageSwitcher.jsx b/src/layouts/common/languageSwitcher/LanguageSwitcher.jsx index 74cbdba..eed9559 100644 --- a/src/layouts/common/languageSwitcher/LanguageSwitcher.jsx +++ b/src/layouts/common/languageSwitcher/LanguageSwitcher.jsx @@ -1,32 +1,48 @@ import React, { useContext } from "react"; import { AppContext } from "App"; import { useTheme } from "@mui/material/styles"; -import { IconButton } from "@mui/material"; +import { IconButton, Tooltip } from "@mui/material"; +import Zoom from "@mui/material/Zoom"; + // import { FormattedMessage } from "react-intl"; import LanguageOutlinedIcon from "@mui/icons-material/LanguageOutlined"; const LanguageSwitcher = () => { const theme = useTheme(); const appContext = useContext(AppContext); + const currentLocale = + appContext && appContext.locale + ? String(appContext.locale).toUpperCase() + : "EN"; + return ( - { - const setLocale = appContext && appContext.setLocale; - if (typeof setLocale === "function") { - setLocale(appContext.locale === "en" ? "nl" : "en"); - } - }} - size="large" - sx={{ - alignSelf: "right", - mr: 1, - ml: 1, - color: theme.palette.text.secondary, - fontSize: "24px", + - {} - + + { + const setLocale = appContext && appContext.setLocale; + if (typeof setLocale === "function") { + setLocale(appContext.locale === "en" ? "nl" : "en"); + } + }} + size="large" + sx={{ + alignSelf: "right", + mr: 1, + ml: 1, + color: theme.palette.text.secondary, + fontSize: "24px", + }}> + {} + + + ); };