Hide Side Bar

This commit is contained in:
Tuan Cao 2022-03-16 11:52:08 +07:00
parent cf2a32caff
commit 1ef445d9d4
2 changed files with 6 additions and 15 deletions

View File

@ -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])

View File

@ -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 {
<section className="section">
{/* SIDEBAR */}
<div
data-w-id="71d5791f-856a-b6c4-e8ee-0ab2729e1de3"
className="sidebar"
id="sidebar"
>
<div dangerouslySetInnerHTML={{__html:this.props.sidebar.data}} />
</div>
{/* CONTENT */}
<main className="main parent-main" id="main">
@ -70,11 +61,11 @@ class MyDocument extends Document {
}
export function getStaticProps() {
const sidebarData = getSinglePost("sidebar.md");
// const sidebarData = getSinglePost("sidebar.md");
console.log("index response: ", contentData, sidebarData)
return {
props: {
sidebar:sidebarData
// sidebar:sidebarData
},
};
}