cleanup not-found component

This commit is contained in:
Sudhanshu Gautam 2021-01-13 22:08:55 +05:30
parent db9f3c2c32
commit a0aedf1563
2 changed files with 13 additions and 19 deletions

View file

@ -29,7 +29,7 @@ const App: FunctionComponent = () => {
<Header />
<Router>
<Switch>
<Route path="" component={Home} />
<Route path="" exact component={Home} />
<Route default component={NotFound} />
</Switch>
</Router>

View file

@ -1,25 +1,19 @@
import React, { FunctionComponent } from 'react';
import { Container, Paper, Typography } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles';
import { Box, Container, Link, Paper, Typography } from '@material-ui/core';
const page404Styles = makeStyles((theme) => ({
root: {
padding: theme.spacing(3, 2),
},
}));
const NotFound: FunctionComponent = () => {
const classes = page404Styles();
return (
const NotFound: FunctionComponent = () => (
<Container style={{ marginTop: '50px' }}>
<Paper className={classes.root} elevation={3}>
<Paper elevation={3}>
<Box padding={3}>
<Typography variant="h5" component="h3">
404 Page Not Found
</Typography>
<Typography component="p">Please head to the home.</Typography>
<Typography component="p">
Please head to the <Link href={process.env.PUBLIC_URL}>home</Link>.
</Typography>
</Box>
</Paper>
</Container>
);
};
);
export default NotFound;