Skip to content

Commit

Permalink
Merge pull request #111 from MeetDOD/issue-105
Browse files Browse the repository at this point in the history
feat: Added a 404 page not found route in frontend Successfully Issue 105
  • Loading branch information
VaibhavArora314 authored Jun 4, 2024
2 parents 4508d92 + 867b26c commit 1bd3846
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
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

0 comments on commit 1bd3846

Please sign in to comment.