Skip to content

Commit

Permalink
Merge pull request #75 from saurabh-dev-vns/feature/NotFoundPage
Browse files Browse the repository at this point in the history
 Add 404 Page Component
  • Loading branch information
Anuj3553 authored Oct 11, 2024
2 parents acfd1c1 + 663c1cf commit ca702c9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { useAtom } from 'jotai';
import { modeAtom } from './atom/Atom';
import ForgotPassword from './component/forgotpass';
import VerifyEmail from './component/Verify';
import NotFound from './component/NotFound';
// Main Layout Component
const Layout = ({ children, mode, setProgress, toggleMode, showAlert }) => {
const location = useLocation(); // Use location inside Router
Expand Down Expand Up @@ -123,7 +124,10 @@ function App() {
<Route exact path="/privacypolicy" element={<PrivacyPolicy mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path="/termofuse" element={<TermOfUse mode={mode} setProgress={setProgress} showAlert={showAlert} />} />
<Route exact path="/verify/:token" element={<VerifyEmail/>} />
{/* 404 Route */}
<Route exact path="*" element={<NotFound/>} />
</Routes>

</Layout>
</Router>
</ProfileState>
Expand Down
23 changes: 23 additions & 0 deletions client/src/component/NotFound.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// src/components/NotFound.jsx

import React from 'react';

const NotFound = () => {
return (
<div className="flex flex-col items-center lg:top-8 lg:relative m-2 justify-center min-h-screen bg-white text-center">
<h1 className="text-6xl font-bold text-gray-800 mb-4">404</h1>
<p className="text-xl text-gray-600 mb-8">Oops! Page Not Found</p>
<p className="text-md text-gray-500 mb-4">
The page you are looking for might have been removed or is temporarily unavailable.
</p>
<a
href="/"
className="mt-4 px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-500 transition duration-300"
>
Go to Homepage
</a>
</div>
);
};

export default NotFound;

0 comments on commit ca702c9

Please sign in to comment.