From e69581cb9fac3c0cf7f86c6dbe25262b3784ecf9 Mon Sep 17 00:00:00 2001 From: Tuan Cao Date: Wed, 16 Mar 2022 17:40:49 +0700 Subject: [PATCH] Delete side bar interaction --- components/layout.js | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/components/layout.js b/components/layout.js index 2d35701..1698b7d 100644 --- a/components/layout.js +++ b/components/layout.js @@ -7,33 +7,10 @@ export const siteTitle = 'Digital Backroom - An Internet Archive' export default function Layout({ children, home }) { const [isOpen, setIsOpen] = useState(null) - const toggle = () => setIsOpen(!isOpen) - - const sidebarposition = isOpen ? "0px" : "-250px" - //console.log("effect: ", isOpen, sidebarposition) - - useEffect(()=>{ - const navbarButtonEl = document.getElementById("nav-button") - //navbarButtonEl.addEventListener("click", function(){console.log("asd"); setIsOpen(!isOpen); }); - navbarButtonEl.addEventListener("click", () => setIsOpen(!isOpen)); - return navbarButtonEl.removeEventListener("click", () => setIsOpen(!isOpen)) - },[isOpen]) - - useEffect(() => { - const sidebarEl = document.getElementById("sidebar"); - //console.log("sidebar position: ", sidebarposition) - //if (isOpen){sidebarEl.classList.add("open"); sidebarEl.classList.remove("close");} - //else {sidebarEl.classList.remove("open"); sidebarEl.classList.add("close")} - - // if (isOpen){sidebarEl.style.left = sidebarposition;} - // else {sidebarEl.style.left = sidebarposition;} - - },[isOpen]) return (
-