Skip to content

Commit

Permalink
Update: Added nodemon and SwaggerJS
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangsonww committed Oct 21, 2024
1 parent 6891264 commit cd349c1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Login from './pages/Login';
import Register from './pages/Register';
import ForgotPassword from './pages/ForgotPassword';
import ResetPassword from './pages/ResetPassword';
import NotFoundPage from './pages/NotFoundPage';

const theme = createTheme({
palette: {
Expand Down Expand Up @@ -80,6 +81,8 @@ function App() {
<Route path="/forgot-password" element={<ForgotPassword />} />

<Route path="/reset-password" element={<ResetPassword />} />

<Route path="*" element={<NotFoundPage />} />
</Routes>
</Container>
</BrowserRouter>
Expand Down
32 changes: 32 additions & 0 deletions src/pages/NotFoundPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from 'react';
import { Box, Typography, Button, Container } from '@mui/material';
import { useNavigate } from 'react-router-dom';

const NotFoundPage = () => {
const navigate = useNavigate();

const handleGoHome = () => {
navigate('/'); // Redirect to the homepage or change the path as needed
};

return (
<Container maxWidth="md" sx={{ textAlign: 'center', mt: 8 }}>
<Typography variant="h2" color="error" gutterBottom>
404
</Typography>
<Typography variant="h5" gutterBottom>
Oops! The page you're looking for doesn't exist.
</Typography>
<Typography variant="body1" paragraph>
It looks like the page you're trying to access is not available or the URL is incorrect.
</Typography>
<Box sx={{ mt: 4 }}>
<Button variant="contained" color="primary" size="large" onClick={handleGoHome}>
Go to Home
</Button>
</Box>
</Container>
);
};

export default NotFoundPage;

0 comments on commit cd349c1

Please sign in to comment.