diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index f034a1849..6e7e8ae8f 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -184,21 +184,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(); @@ -244,18 +258,18 @@ export const SidebarLayout = ({ children }: { children: React.ReactNode }) => {
+
+
-
+
-
+
-
+
void; }) => { const router = useRouter(); + /* eslint-disable no-constant-condition */ const [active, setActive] = useState({ getDocs: false, getStarted: false, diff --git a/pages/index.page.tsx b/pages/index.page.tsx index 95fb51ddd..3db9e3d07 100644 --- a/pages/index.page.tsx +++ b/pages/index.page.tsx @@ -512,22 +512,23 @@ const Home = (props: any) => { and by appointment. Open Community Working Meetings are every third Monday of the month at 12:00 PT.

-