component: add SideDrawer toogle button
This commit is contained in:
parent
b79cb5e3ff
commit
4deeab8324
@ -7,17 +7,23 @@ import SideDrawer from '../Navigation/SideDrawer/SideDrawer';
|
||||
|
||||
class Layout extends Component {
|
||||
state = {
|
||||
showSideDrawer: true
|
||||
showSideDrawer: false,
|
||||
}
|
||||
|
||||
sideDrawerClosedHandler = () => {
|
||||
this.setState({showSideDrawer: false});
|
||||
}
|
||||
|
||||
sideDrawerToggleHandler = () => {
|
||||
this.setState((prevState) => {
|
||||
return {showSideDrawer: !prevState.showSideDrawer };
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Aux>
|
||||
<Toolbar />
|
||||
<Toolbar drawerToggleClicked={this.sideDrawerToggleHandler} />
|
||||
<SideDrawer open={this.state.showSideDrawer} closed={this.sideDrawerClosedHandler} />
|
||||
<main className={classes.Content}>
|
||||
{this.state.children}
|
||||
|
@ -0,0 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
|
||||
const drawerToggle = (props) => (
|
||||
<div onClick={props.clicked}>MENU</div>
|
||||
)
|
||||
|
||||
export default drawerToggle;
|
@ -3,11 +3,12 @@ import React from 'react';
|
||||
import classes from './Toolbar.css';
|
||||
import Logo from '../../Logo/Logo';
|
||||
import NavigationItems from '../NavigationItems/NavigationItems';
|
||||
import DrawerToggle from '../SideDrawer/DrawerToggle/DrawerToggle';
|
||||
|
||||
const toolbar = () => {
|
||||
const toolbar = (props) => {
|
||||
return (
|
||||
<header className={classes.Toolbar}>
|
||||
<div>MENU</div>
|
||||
<DrawerToggle clicked={props.drawerToggleClicked} />
|
||||
<div className={classes.Logo}>
|
||||
<Logo />
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user