Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 404 Page Component #75

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Loading