Files
Checkmate/client/src/Components/Layouts/AppLayout/index.jsx
T

31 lines
797 B
React
Raw Normal View History

2025-06-12 09:37:51 +08:00
import Box from "@mui/material/Box";
import PropTypes from "prop-types";
import { useTheme } from "@emotion/react";
import BackgroundSVG from "../../../assets/Images/background.svg";
2025-06-23 12:34:30 +08:00
import { useSelector } from "react-redux";
2025-06-12 09:37:51 +08:00
const AppLayout = ({ children }) => {
const theme = useTheme();
2025-06-23 12:34:30 +08:00
const ui = useSelector((state) => state.ui);
2025-06-12 09:37:51 +08:00
return (
<Box
sx={{
minHeight: "100vh",
backgroundColor: theme.palette.primaryBackground.main,
2025-06-23 12:34:30 +08:00
backgroundImage: ui?.mode === "dark" ? `url("${BackgroundSVG}")` : "none",
2025-06-12 09:37:51 +08:00
backgroundSize: "100% 100%",
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
color: theme.palette.primary.contrastText,
}}
>
{children}
</Box>
);
};
AppLayout.propTypes = {
children: PropTypes.node,
};
export default AppLayout;