From db88a7699ce75a738458710de3018f87d3a6ee23 Mon Sep 17 00:00:00 2001 From: William Tran Date: Mon, 5 Jul 2021 13:02:04 -0400 Subject: [PATCH] Make burger disappear when off screen --- components/OrganizedContent.tsx | 50 +++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/components/OrganizedContent.tsx b/components/OrganizedContent.tsx index fc3dd357..528e2689 100644 --- a/components/OrganizedContent.tsx +++ b/components/OrganizedContent.tsx @@ -49,8 +49,11 @@ export function OrganizedContent(props: Props) { : (document.body.style.overflow = "visible"); }, [open]); + const ref = useRef(null); + const isVisible = useOnScreen(ref); + return ( -
+