fix
This commit is contained in:
@ -1,45 +1,43 @@
|
||||
import { Box, Typography, Container } from '@mui/material';
|
||||
import Vehicle from './Vehicle';
|
||||
import Personal from './Personal';
|
||||
import { Navigate } from 'react-router-dom';
|
||||
import Divider from '../../components/Divider';
|
||||
import { Box, Typography, Container } from "@mui/material";
|
||||
import Vehicle from "./Vehicle";
|
||||
import Personal from "./Personal";
|
||||
import { Navigate } from "react-router-dom";
|
||||
import Divider from "../../components/Divider";
|
||||
|
||||
const AdminMainPage = () => {
|
||||
const isAuth = localStorage.getItem('token') !== null;
|
||||
|
||||
const isAuth = localStorage.getItem("token") !== null;
|
||||
|
||||
// Перенаправление на страницу логина, если пользователь не авторизован
|
||||
if (!isAuth) {
|
||||
return <Navigate to="/administrator" replace />;
|
||||
}
|
||||
|
||||
return (
|
||||
<Box sx={{ width: '100%', color: 'black', minHeight: '100vh' }}>
|
||||
<Container maxWidth="lg" sx={{ pt: "1vw" }}>
|
||||
<Box sx={{ width: "100%", color: "black", minHeight: "100vh" }}>
|
||||
<Container maxWidth="xl" sx={{ pt: "1vw" }}>
|
||||
<Box id="vehicles">
|
||||
<Typography
|
||||
variant="h5"
|
||||
component="h2"
|
||||
sx={{
|
||||
fontFamily: 'Unbounded',
|
||||
fontWeight: 'bold'
|
||||
<Typography
|
||||
variant="h5"
|
||||
component="h2"
|
||||
sx={{
|
||||
fontFamily: "Unbounded",
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
</Typography>
|
||||
></Typography>
|
||||
<Vehicle />
|
||||
</Box>
|
||||
|
||||
<Divider marginBottomDivider='1vw' marginTopDivider='5vw' />
|
||||
|
||||
|
||||
<Divider marginBottomDivider="1vw" marginTopDivider="5vw" />
|
||||
|
||||
<Box id="personal">
|
||||
<Typography
|
||||
variant="h5"
|
||||
component="h2"
|
||||
sx={{
|
||||
fontFamily: 'Unbounded',
|
||||
fontWeight: 'bold'
|
||||
<Typography
|
||||
variant="h5"
|
||||
component="h2"
|
||||
sx={{
|
||||
fontFamily: "Unbounded",
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
</Typography>
|
||||
></Typography>
|
||||
<Personal />
|
||||
</Box>
|
||||
</Container>
|
||||
|
Reference in New Issue
Block a user