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

feat: Added a 404 page not found route in frontend Successfully Issue 105 #111

Merged
merged 6 commits into from
Jun 4, 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
5 changes: 3 additions & 2 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "./App.css";
import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom";
import { BrowserRouter, Route, Routes } from "react-router-dom";
import Navbar from "./components/Navbar";
import Footer from "./components/Footer";
import Home from "./pages/Home";
Expand All @@ -19,6 +19,7 @@ import About from "./pages/About";
import Policy from "./pages/Policy";
import GoTop from "./components/GoTop";
import { Toaster } from 'react-hot-toast';
import PageNotFound from "./pages/PageNotFound";
// import axios from "axios";
// axios.defaults.baseURL = "http://localhost:3001/";

Expand Down Expand Up @@ -84,7 +85,7 @@ function App() {
<Policy />
}
/>
<Route path="*" element={<Navigate to="/app" />} />
<Route path="*" element={<PageNotFound/>} />
</Routes>
</div>

Expand Down
Binary file added frontend/src/assets/notFound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions frontend/src/pages/PageNotFound.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import notfound from '../assets/notFound.png'

const PageNotFound = () => {
return (
<div className='flex flex-col items-center justify-center mx-auto'>
<img src={notfound} alt='Page Not Found' className='w-[400px]' />
<p className='text-center mb-20'>
<span className='text-red-600 font-bold text-6xl'>404</span><br />
<span className='text-gray-200 ite text-3xl font-semibold'>Page Not Found</span>
</p>
</div>
)
}

export default PageNotFound
Loading