Refactor project data structure, add internationalization support, and enhance UI components
- Updated project data files to improve formatting and consistency. - Introduced language support with English and Dutch translations. - Implemented language switcher and dark mode toggle in the header and footer. - Enhanced navigation components to utilize internationalized strings. - Refactored layout components to use Grid2 for better responsiveness. - Improved accessibility and usability across various components.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import React, { useContext } from "react";
|
||||
import { AppContext } from "App";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
import { IconButton } from "@mui/material";
|
||||
// import { FormattedMessage } from "react-intl";
|
||||
import LanguageOutlinedIcon from "@mui/icons-material/LanguageOutlined";
|
||||
|
||||
const LanguageSwitcher = () => {
|
||||
const theme = useTheme();
|
||||
const appContext = useContext(AppContext);
|
||||
return (
|
||||
<IconButton
|
||||
onClick={() => {
|
||||
const setLocale = appContext && appContext.setLocale;
|
||||
if (typeof setLocale === "function") {
|
||||
setLocale(appContext.locale === "en" ? "nl" : "en");
|
||||
}
|
||||
}}
|
||||
sx={{
|
||||
color: theme.palette.text.secondary,
|
||||
alignSelf: "right",
|
||||
}}>
|
||||
{<LanguageOutlinedIcon />}
|
||||
</IconButton>
|
||||
);
|
||||
};
|
||||
|
||||
export default LanguageSwitcher;
|
||||
Reference in New Issue
Block a user