Skip to content

Commit f2c1182

Browse files
committed
feat(auth): add NotAuthorized and NotFound pages
1 parent 5c93210 commit f2c1182

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

src/ui/views/Extras/NotAuthorized.jsx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import React from 'react';
2+
import { useNavigate } from 'react-router-dom';
3+
import Card from '../../components/Card/Card';
4+
import CardBody from '../../components/Card/CardBody';
5+
import GridContainer from '../../components/Grid/GridContainer';
6+
import GridItem from '../../components/Grid/GridItem';
7+
import { Button } from '@material-ui/core';
8+
import LockIcon from '@material-ui/icons/Lock';
9+
10+
const NotAuthorized = () => {
11+
const navigate = useNavigate();
12+
13+
return (
14+
<GridContainer justifyContent='center' style={{ marginTop: '50px' }}>
15+
<GridItem xs={12} sm={8} md={6}>
16+
<Card>
17+
<CardBody style={{ textAlign: 'center', padding: '40px' }}>
18+
<LockIcon style={{ fontSize: '60px', color: 'red' }} />
19+
<h2>403 - Not Authorized</h2>
20+
<p>
21+
You do not have permission to access this page. Contact your administrator for more
22+
information, or try logging in with a different account.
23+
</p>
24+
<Button
25+
variant='contained'
26+
color='primary'
27+
onClick={() => navigate('/')}
28+
style={{ marginTop: '20px' }}
29+
>
30+
Go to Home
31+
</Button>
32+
</CardBody>
33+
</Card>
34+
</GridItem>
35+
</GridContainer>
36+
);
37+
};
38+
39+
export default NotAuthorized;

src/ui/views/Extras/NotFound.jsx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React from 'react';
2+
import { useNavigate } from 'react-router-dom';
3+
import Card from '../../components/Card/Card';
4+
import CardBody from '../../components/Card/CardBody';
5+
import GridContainer from '../../components/Grid/GridContainer';
6+
import GridItem from '../../components/Grid/GridItem';
7+
import { Button } from '@material-ui/core';
8+
import ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';
9+
10+
const NotFound = () => {
11+
const navigate = useNavigate();
12+
13+
return (
14+
<GridContainer justifyContent='center' style={{ marginTop: '50px' }}>
15+
<GridItem xs={12} sm={8} md={6}>
16+
<Card>
17+
<CardBody style={{ textAlign: 'center', padding: '40px' }}>
18+
<ErrorOutlineIcon style={{ fontSize: '60px', color: 'gray' }} />
19+
<h2>404 - Page Not Found</h2>
20+
<p>The page you are looking for does not exist. It may have been moved or deleted.</p>
21+
<Button
22+
variant='contained'
23+
color='primary'
24+
onClick={() => navigate('/')}
25+
style={{ marginTop: '20px' }}
26+
>
27+
Go to Home
28+
</Button>
29+
</CardBody>
30+
</Card>
31+
</GridItem>
32+
</GridContainer>
33+
);
34+
};
35+
36+
export default NotFound;

0 commit comments

Comments
 (0)