From 5c16d49895af599b03e4c7a3087f381c480cea67 Mon Sep 17 00:00:00 2001 From: Yashwanth1906 Date: Mon, 10 Mar 2025 14:50:14 +0530 Subject: [PATCH 1/5] [Refactor] : button-refactor --- pages/index.page.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pages/index.page.tsx b/pages/index.page.tsx index ab35d29d8..92bd0b336 100644 --- a/pages/index.page.tsx +++ b/pages/index.page.tsx @@ -503,18 +503,19 @@ const Home = (props: any) => { and by appointment. Open Community Working Meetings are every third Monday of the month at 12:00 PT.

-
- -
+
From 3274903aea18b3c89f4c6557d7aacdb679fbde92 Mon Sep 17 00:00:00 2001 From: Yashwanth1906 Date: Mon, 10 Mar 2025 17:21:41 +0530 Subject: [PATCH 2/5] [BUG] : Made the component flexible --- pages/index.page.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pages/index.page.tsx b/pages/index.page.tsx index 92bd0b336..3741f4f24 100644 --- a/pages/index.page.tsx +++ b/pages/index.page.tsx @@ -503,19 +503,24 @@ const Home = (props: any) => { and by appointment. Open Community Working Meetings are every third Monday of the month at 12:00 PT.

-
- -
-
From cd4aa358dc521224b937a5d56dad641304338030 Mon Sep 17 00:00:00 2001 From: Yashwanth1906 Date: Fri, 14 Mar 2025 19:01:46 +0530 Subject: [PATCH 3/5] [FIXED] : Scroll Issue --- components/Sidebar.tsx | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index ad52e2ab8..1cc118ac9 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -175,21 +175,34 @@ 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) { + if (typeof window !== 'undefined') { + if (open) { + document.body.style.overflow = 'hidden'; + } else { + document.body.style.overflow = 'unset'; + } + window.addEventListener('resize', () => { if (window.innerWidth > 1024) { setOpen(false); + document.body.style.overflow = 'unset'; } }); + + return () => { + document.body.style.overflow = 'unset'; + }; } - }, [typeof window !== 'undefined']); + }, [open]); + return (
-
-
+
+
e.stopPropagation()} onClick={(e) => { e.stopPropagation(); @@ -235,16 +248,18 @@ export const SidebarLayout = ({ children }: { children: React.ReactNode }) => {
+
+
-
+
-
+
-
+
void; }) => { const router = useRouter(); - /* eslint-disable no-constant-condition */ const [active, setActive] = useState({ getDocs: false, From 3e26a94d330dda2ced9099b6bec8bbef48b52f50 Mon Sep 17 00:00:00 2001 From: Yashwanth1906 Date: Tue, 18 Mar 2025 14:19:07 +0530 Subject: [PATCH 4/5] [FIX]: Fixed the bg-color for sidebar --- components/Sidebar.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 1cc118ac9..733de0e97 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -251,15 +251,15 @@ export const SidebarLayout = ({ children }: { children: React.ReactNode }) => {
-
+
-
+
Date: Tue, 25 Mar 2025 17:50:15 +0530 Subject: [PATCH 5/5] removed the event-listener --- components/Sidebar.tsx | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index c95e6c973..f90d8a051 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -178,24 +178,25 @@ export const SidebarLayout = ({ children }: { children: React.ReactNode }) => { const pathWtihoutFragment = extractPathWithoutFragment(router.asPath); useEffect(() => { - if (typeof window !== 'undefined') { - if (open) { - document.body.style.overflow = 'hidden'; - } else { + const handleResize = () => { + if (window.innerWidth > 1024) { + setOpen(false); document.body.style.overflow = 'unset'; } + }; - window.addEventListener('resize', () => { - if (window.innerWidth > 1024) { - setOpen(false); - document.body.style.overflow = 'unset'; - } - }); - - return () => { - document.body.style.overflow = 'unset'; - }; + if (open) { + document.body.style.overflow = 'hidden'; + } else { + document.body.style.overflow = 'unset'; } + + window.addEventListener('resize', handleResize); + + return () => { + window.removeEventListener('resize', handleResize); + document.body.style.overflow = 'unset'; + }; }, [open]); return ( @@ -252,9 +253,9 @@ export const SidebarLayout = ({ children }: { children: React.ReactNode }) => {
-
+