Merge pull request #354 from getmaxun/invalid-route
feat: handle invalid routes
This commit is contained in:
11
src/components/dashboard/NotFound.tsx
Normal file
11
src/components/dashboard/NotFound.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
|
||||
export function NotFoundPage() {
|
||||
return (
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
<h1>404 - Page Not Found</h1>
|
||||
<p>Oops! This page does not exist.</p>
|
||||
<a href="/" style={{ textDecoration: 'none' }}>Take me to the homepage</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import Login from './Login';
|
||||
import Register from './Register';
|
||||
import UserRoute from '../routes/userRoute';
|
||||
import { Routes, Route, useNavigate, Navigate } from 'react-router-dom';
|
||||
import { Runs } from '../components/run/Runs';
|
||||
import { NotFoundPage } from '../components/dashboard/NotFound';
|
||||
|
||||
export const PageWrapper = () => {
|
||||
const [open, setOpen] = useState(false);
|
||||
@@ -75,6 +75,7 @@ export const PageWrapper = () => {
|
||||
path="/register"
|
||||
element={<Register />}
|
||||
/>
|
||||
<Route path="*" element={<NotFoundPage />} />
|
||||
</Routes>
|
||||
</React.Fragment>
|
||||
</SocketProvider>
|
||||
|
||||
Reference in New Issue
Block a user