From e2c5ad76be96fa051511d05ab3849937be318ebc Mon Sep 17 00:00:00 2001 From: hokageCodes Date: Mon, 5 Dec 2022 12:36:09 +0000 Subject: [PATCH 1/2] izz going now o --- frontend/src/pages/Error404/index.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/Error404/index.jsx b/frontend/src/pages/Error404/index.jsx index dc30cf37..980ffe33 100644 --- a/frontend/src/pages/Error404/index.jsx +++ b/frontend/src/pages/Error404/index.jsx @@ -19,12 +19,12 @@ export default function Error404 () {

We could not find what you searched for. Try searching again

- Go to Home - + ); From ee5c5df4243332b774e0bde0dd317adcdd40898e Mon Sep 17 00:00:00 2001 From: hokageCodes Date: Mon, 5 Dec 2022 13:04:49 +0000 Subject: [PATCH 2/2] scroll to top on route component/function added --- frontend/src/components/ScrollToTop/index.jsx | 12 ++++++++++++ frontend/src/index.jsx | 1 + 2 files changed, 13 insertions(+) create mode 100644 frontend/src/components/ScrollToTop/index.jsx diff --git a/frontend/src/components/ScrollToTop/index.jsx b/frontend/src/components/ScrollToTop/index.jsx new file mode 100644 index 00000000..ade9f235 --- /dev/null +++ b/frontend/src/components/ScrollToTop/index.jsx @@ -0,0 +1,12 @@ +import {useEffect} from 'react' +import { useLocation } from 'react-router-dom'; + +export default function ScrollToTop() { + const { pathname } = useLocation(); + + useEffect(() => { + window.scrollTo(0, 0); + + }, [pathname]) + return null; +} \ No newline at end of file diff --git a/frontend/src/index.jsx b/frontend/src/index.jsx index d52bb8d0..f288dad5 100644 --- a/frontend/src/index.jsx +++ b/frontend/src/index.jsx @@ -43,6 +43,7 @@ import Privacy from './pages/Privacy'; // } from './pages/Dashboard/DashboardMain/UploadFile/Upload'; const router = createBrowserRouter([ + { path: '/', element: ,