From 1ef445d9d4fe11a990304201f1858758ae3d6a24 Mon Sep 17 00:00:00 2001 From: Tuan Cao Date: Wed, 16 Mar 2022 11:52:08 +0700 Subject: [PATCH] Hide Side Bar --- components/layout.js | 4 ++-- pages/_document.js | 17 ++++------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/components/layout.js b/components/layout.js index 415362b..2d35701 100644 --- a/components/layout.js +++ b/components/layout.js @@ -25,8 +25,8 @@ export default function Layout({ children, home }) { //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;} + // if (isOpen){sidebarEl.style.left = sidebarposition;} + // else {sidebarEl.style.left = sidebarposition;} },[isOpen]) diff --git a/pages/_document.js b/pages/_document.js index 3b5ba9e..8f195e0 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -9,8 +9,8 @@ class MyDocument extends Document { static async getInitialProps(ctx) { const initialProps = await Document.getInitialProps(ctx) //console.log("doc", initialProps) - const sidebar = getSinglePost("sidebar") - return { sidebar, ...initialProps } + + return { ...initialProps } } render(props) { @@ -45,16 +45,7 @@ class MyDocument extends Document {
- {/* SIDEBAR */} -