2022-09-08 17:21:17 +00:00
|
|
|
import * as React from "react";
|
|
|
|
import { Box } from "@mui/material";
|
2022-09-09 13:54:49 +00:00
|
|
|
import { ThemeProvider } from "@mui/material";
|
|
|
|
import CssBaseline from '@mui/material/CssBaseline';
|
2022-09-08 17:21:17 +00:00
|
|
|
import Menu from "../Menu";
|
|
|
|
import Header from "../Header";
|
|
|
|
import Content from "../Content";
|
2022-09-14 10:24:02 +00:00
|
|
|
import ModalWindow from "../ModalWindow";
|
|
|
|
import theme from "../../theme";
|
|
|
|
import { useMatch } from "react-router-dom";
|
|
|
|
import useStore from "../../store";
|
|
|
|
|
|
|
|
|
|
|
|
const LoggedIn: React.FC = () => {
|
|
|
|
const handleOpen = useStore((state) => state.handleOpen);
|
|
|
|
const handleClose = useStore((state) => state.handleClose);
|
2022-09-08 17:21:17 +00:00
|
|
|
|
2022-09-14 10:24:02 +00:00
|
|
|
const match = useMatch('/modal');
|
|
|
|
match ? handleOpen() : handleClose()
|
|
|
|
|
|
|
|
|
2022-09-08 17:21:17 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<React.Fragment>
|
2022-09-09 13:54:49 +00:00
|
|
|
<ThemeProvider theme={theme}>
|
|
|
|
<CssBaseline />
|
|
|
|
<Box sx={{
|
|
|
|
backgroundColor: theme.palette.primary.main,
|
|
|
|
color: theme.palette.secondary.main,
|
|
|
|
height: "100%"
|
2022-09-08 17:21:17 +00:00
|
|
|
}}>
|
2022-09-09 13:54:49 +00:00
|
|
|
<Box sx={{
|
|
|
|
backgroundColor: theme.palette.content.main,
|
|
|
|
display: "flex",
|
|
|
|
width: "100%",
|
|
|
|
height: "100%"
|
|
|
|
}}>
|
|
|
|
|
|
|
|
<Menu />
|
|
|
|
<Box sx={{
|
|
|
|
width: "100%",
|
|
|
|
display: "flex",
|
|
|
|
flexDirection: "column",
|
|
|
|
justifyContent: "space-between",
|
|
|
|
alignItems: "center"
|
|
|
|
}}>
|
|
|
|
<Header />
|
|
|
|
<Content />
|
|
|
|
</Box>
|
|
|
|
</Box>
|
2022-09-08 17:21:17 +00:00
|
|
|
</Box>
|
2022-09-14 10:24:02 +00:00
|
|
|
|
|
|
|
<ModalWindow />
|
|
|
|
|
2022-09-09 13:54:49 +00:00
|
|
|
</ThemeProvider>
|
2022-09-08 17:21:17 +00:00
|
|
|
</React.Fragment>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-14 10:24:02 +00:00
|
|
|
export default LoggedIn;
|