diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 71210bd7c..f90d8a051 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -176,21 +176,35 @@ export const SidebarLayout = ({ children }: { children: React.ReactNode }) => { const handleRotate = () => setRotateChevron(!rotateChevron); const rotate = rotateChevron ? 'rotate(180deg)' : 'rotate(0)'; const pathWtihoutFragment = extractPathWithoutFragment(router.asPath); + useEffect(() => { - if (window) { - window.addEventListener('resize', () => { - if (window.innerWidth > 1024) { - setOpen(false); - } - }); + const handleResize = () => { + if (window.innerWidth > 1024) { + setOpen(false); + document.body.style.overflow = 'unset'; + } + }; + + if (open) { + document.body.style.overflow = 'hidden'; + } else { + document.body.style.overflow = 'unset'; } - }, [typeof window !== 'undefined']); + + window.addEventListener('resize', handleResize); + + return () => { + window.removeEventListener('resize', handleResize); + document.body.style.overflow = 'unset'; + }; + }, [open]); + return (
-
-
+
+
e.stopPropagation()} onClick={(e) => { e.stopPropagation(); @@ -236,16 +250,18 @@ export const SidebarLayout = ({ children }: { children: React.ReactNode }) => {
+
+
-
+
-
+
-
+
void; }) => { const router = useRouter(); - /* eslint-disable no-constant-condition */ const [active, setActive] = useState({ getDocs: false, diff --git a/pages/index.page.tsx b/pages/index.page.tsx index 098f44bef..c123797d4 100644 --- a/pages/index.page.tsx +++ b/pages/index.page.tsx @@ -503,14 +503,20 @@ const Home = (props: any) => { and by appointment. Open Community Working Meetings are every third Monday of the month at 12:00 PT.

-