add admin
This commit is contained in:
50
src/pages/admin/AdminMainPage.tsx
Normal file
50
src/pages/admin/AdminMainPage.tsx
Normal file
@ -0,0 +1,50 @@
|
||||
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;
|
||||
|
||||
// Перенаправление на страницу логина, если пользователь не авторизован
|
||||
if (!isAuth) {
|
||||
return <Navigate to="/administrator" replace />;
|
||||
}
|
||||
|
||||
return (
|
||||
<Box sx={{ width: '100%', color: 'black', minHeight: '100vh' }}>
|
||||
<Container maxWidth="lg" sx={{ pt: "1vw" }}>
|
||||
<Box id="vehicles">
|
||||
<Typography
|
||||
variant="h5"
|
||||
component="h2"
|
||||
sx={{
|
||||
fontFamily: 'Unbounded',
|
||||
fontWeight: 'bold'
|
||||
}}
|
||||
>
|
||||
</Typography>
|
||||
<Vehicle />
|
||||
</Box>
|
||||
|
||||
<Divider marginBottomDivider='1vw' marginTopDivider='5vw' />
|
||||
|
||||
<Box id="personal">
|
||||
<Typography
|
||||
variant="h5"
|
||||
component="h2"
|
||||
sx={{
|
||||
fontFamily: 'Unbounded',
|
||||
fontWeight: 'bold'
|
||||
}}
|
||||
>
|
||||
</Typography>
|
||||
<Personal />
|
||||
</Box>
|
||||
</Container>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default AdminMainPage;
|
Reference in New Issue
Block a user