Add 404 page

This commit is contained in:
Ken Hibino 2021-01-07 06:41:33 -08:00
parent b572b76a0b
commit 41c4eb8097
3 changed files with 42 additions and 7 deletions

View File

@ -34,6 +34,7 @@ import TasksView from "./views/TasksView";
import SettingsView from "./views/SettingsView";
import ServersView from "./views/ServersView";
import RedisInfoView from "./views/RedisInfoView";
import PageNotFoundView from "./views/PageNotFoundView";
const drawerWidth = 220;
@ -273,9 +274,12 @@ function App(props: ConnectedProps<typeof connector>) {
<Route exact path={paths.SETTINGS}>
<SettingsView />
</Route>
<Route path={paths.HOME}>
<Route exact path={paths.HOME}>
<DashboardView />
</Route>
<Route path="*">
<PageNotFoundView />
</Route>
</Switch>
</div>
</main>

View File

@ -0,0 +1,37 @@
import React from "react";
import Container from "@material-ui/core/Container";
import { makeStyles } from "@material-ui/core/styles";
import Grid from "@material-ui/core/Grid";
import Typography from "@material-ui/core/Typography";
const useStyles = makeStyles((theme) => ({
container: {
paddingTop: theme.spacing(4),
paddingBottom: theme.spacing(4),
},
headingText: {
fontWeight: "bold",
},
}));
export default function PageNotFoundView() {
const classes = useStyles();
return (
<Container maxWidth="lg" className={classes.container}>
<Grid container spacing={3}>
<Grid item xs={12}>
<Typography
variant="h5"
align="center"
className={classes.headingText}
>
Oops!
</Typography>
<Typography variant="subtitle1" color="textSecondary" align="center">
404 - Page Not Found
</Typography>
</Grid>
</Grid>
</Container>
);
}

View File

@ -18,12 +18,6 @@ const useStyles = makeStyles((theme) => ({
paddingTop: theme.spacing(4),
paddingBottom: theme.spacing(4),
},
paper: {
padding: theme.spacing(2),
display: "flex",
overflow: "auto",
flexDirection: "column",
},
}));
function mapStateToProps(state: AppState) {