From ddc1bb47c24db2c49e764e4f77e777331e2e11a2 Mon Sep 17 00:00:00 2001 From: bharateshwq Date: Sun, 27 Oct 2024 23:52:52 +0530 Subject: [PATCH] fixed scroll to top developers page --- src/pages/DeveloperLayout.jsx | 48 +++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/src/pages/DeveloperLayout.jsx b/src/pages/DeveloperLayout.jsx index b8dc45435..124cd0e9c 100644 --- a/src/pages/DeveloperLayout.jsx +++ b/src/pages/DeveloperLayout.jsx @@ -4,16 +4,36 @@ import style from "../style/index.js"; import PageHeader from "../layout/PageHeader.jsx"; import { Outlet, useLocation } from "react-router-dom"; import { Helmet } from "react-helmet"; +import { useEffect } from "react"; export default function DeveloperLayout() { const { pathname } = useLocation(); + // Scroll to top on pathname change + useEffect(() => { + window.scrollTo(0, 0); + }, [pathname]); + + const renderMainContent = () => ( + <> +
+ +

+ Welcome to the Developer Tools page for PolicyEngine. This hub is + designed to enhance your experience with our open-source projects by + providing quick access to essential resources. +

+
+ +