changed from hexo to custom react stuff #1
1 changed files with 1 additions and 3 deletions
|
@ -28,9 +28,7 @@ export default class Sidebar extends React.Component<
|
||||||
// for some reason this.setState only works if this is an arrow function
|
// for some reason this.setState only works if this is an arrow function
|
||||||
toggleSidebar = () => {
|
toggleSidebar = () => {
|
||||||
this.setState({ isSidebarOpen: !this.state.isSidebarOpen })
|
this.setState({ isSidebarOpen: !this.state.isSidebarOpen })
|
||||||
document.body.style.overflow = this.state.isSidebarOpen
|
document.body.style.overflow = this.state.isSidebarOpen ? "" : "hidden"
|
||||||
? "scroll"
|
|
||||||
: "hidden"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CommonSidebarToggleButtonStyle = css`
|
CommonSidebarToggleButtonStyle = css`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue