From e8fad94a46c937dbb4a1d9feba4bf04ac82746f3 Mon Sep 17 00:00:00 2001 From: Syed Moazam Ali <107930498+MoazamAli45@users.noreply.github.com> Date: Tue, 15 Oct 2024 16:58:34 +0500 Subject: [PATCH 1/3] Custom 404 Page Added --- src/App.jsx | 20 +++++++++++--------- src/components/NotFound.jsx | 31 +++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 src/components/NotFound.jsx diff --git a/src/App.jsx b/src/App.jsx index 059a4db..ec5e303 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,12 +1,13 @@ // import React from 'react'; -import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; -import Header from './components/Header'; -import Home from './components/Home'; -import Appointments from './components/Appointments'; -import Patients from './components/Patients'; -import Doctors from './components/Doctors'; -import Admin from './components/Admin'; -import Footer from './components/Footer'; +import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; +import Header from "./components/Header"; +import Home from "./components/Home"; +import Appointments from "./components/Appointments"; +import Patients from "./components/Patients"; +import Doctors from "./components/Doctors"; +import Admin from "./components/Admin"; +import Footer from "./components/Footer"; +import NotFound from "./components/NotFound"; function App() { return ( @@ -20,6 +21,8 @@ function App() { } /> } /> } /> + {/* Catching All other routes */} + } /> @@ -28,5 +31,4 @@ function App() { ); } - export default App; diff --git a/src/components/NotFound.jsx b/src/components/NotFound.jsx new file mode 100644 index 0000000..3b1f72f --- /dev/null +++ b/src/components/NotFound.jsx @@ -0,0 +1,31 @@ +import { Link } from "react-router-dom"; + +const NotFound = () => { + return ( + + + + + 404 + + + {"Something's missing."} + + + { + " Sorry, we can't find that page. You'll find lots to explore on the home page." + } + + + Back to Homepage + + + + + ); +}; + +export default NotFound; From f63b888813b4cd68608a6722bdfe57ef7d3d4013 Mon Sep 17 00:00:00 2001 From: Mayank Gupta Date: Tue, 15 Oct 2024 20:57:02 +0530 Subject: [PATCH 2/3] working --- Frontend/src/components/Header.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Frontend/src/components/Header.jsx b/Frontend/src/components/Header.jsx index cf3c45c..975d666 100644 --- a/Frontend/src/components/Header.jsx +++ b/Frontend/src/components/Header.jsx @@ -4,7 +4,7 @@ import { useMediaQuery } from "../hooks/useMediaQuery"; const Header = () => { const isTablet = useMediaQuery("only screen and (max-width: 768px)"); - const [isMenuOpen, setIsMenuOpen] = useState(false);// Use useNavigate instead of useHistory + const [isMenuOpen, setIsMenuOpen] = useState(false); const toggleMenu = () => { setIsMenuOpen(!isMenuOpen); @@ -13,7 +13,12 @@ const Header = () => { return ( - HMS + + {/* Wrap HMS with a Link component */} + + HMS + + {isTablet ? ( <> From ec1919253890204744880cb7c2b0a361d55805bc Mon Sep 17 00:00:00 2001 From: Yazdan Haider Date: Tue, 15 Oct 2024 21:34:21 +0530 Subject: [PATCH 3/3] Deleted comment in App --- Frontend/src/App.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/Frontend/src/App.jsx b/Frontend/src/App.jsx index ec5e303..ab9345c 100644 --- a/Frontend/src/App.jsx +++ b/Frontend/src/App.jsx @@ -21,7 +21,6 @@ function App() { } /> } /> } /> - {/* Catching All other routes */} } />
+ {"Something's missing."} +
+ { + " Sorry, we can't find that page. You'll find lots to explore on the home page." + } +