Delete side bar interaction

This commit is contained in:
Tuan Cao 2022-03-16 17:40:49 +07:00
parent 7927855016
commit e69581cb9f

View File

@ -7,33 +7,10 @@ export const siteTitle = 'Digital Backroom - An Internet Archive'
export default function Layout({ children, home }) { export default function Layout({ children, home }) {
const [isOpen, setIsOpen] = useState(null) 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 ( return (
<div > <div >
<Head> <Head>
<link rel="icon" href="/favicon.ico" />
<meta <meta
name="description" name="description"
content="A Digital Backroom of Can Burak Sofyalioglu" content="A Digital Backroom of Can Burak Sofyalioglu"