Merge pull request #354 from getmaxun/invalid-route

feat: handle invalid routes
This commit is contained in:
Karishma Shukla
2025-01-15 18:20:03 +05:30
committed by GitHub
2 changed files with 13 additions and 1 deletions

View 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>
);
}

View File

@@ -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>