Skip to content

Commit

Permalink
web 404 page
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidd-77 committed Dec 25, 2024
1 parent 20a9d36 commit b421f19
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Home from "./pages/Home";
import Login from "./pages/Login";
import Signup from "./pages/Signup";
import Chat from "./pages/Chat";
import NotFoundPage from "./pages/NotFound";
import { ProtectedRoute } from "./components/ProtectedRoute";

export default function App() {
Expand All @@ -22,6 +23,7 @@ export default function App() {
</ProtectedRoute>
}
/>
<Route path="*" element={<NotFoundPage />} />
</Routes>
</BrowserRouter>
</NextUIProvider>
Expand Down
17 changes: 17 additions & 0 deletions apps/web/src/pages/NotFound.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { useLocation } from "react-router-dom";

const NotFoundPage = () => {
const location = useLocation();

return (
<div style={{ textAlign: "center", padding: "2rem" }}>
<h1>404 - Page Not Found</h1>
<p>The page <strong>{location.pathname}</strong> does not exist.</p>
<a href="/" style={{ color: "blue", textDecoration: "underline" }}>
Go back to the homepage
</a>
</div>
);
};

export default NotFoundPage;

0 comments on commit b421f19

Please sign in to comment.