text: import React, { Component } from 'react';
  import { connect } from 'react-redux';
  
  import Aux from '../../hoc/Aux/Aux';
  import css from './Layout.css';
  import Toolbar from '../../components/Navigation/Toolbar/Toolbar';
  import SideDrawer from '../../components/Navigation/SideDrawer/SideDrawer';
  
  // ga butuh <div></div>, karena udah react16, ini bakal return array
  class Layout extends Component {
      state = {
          showSideDrawer: false,
      }
  
      sideDrawerClosedHandler = () => {
          this.setState({ showSideDrawer: false })
      }
  
      sideDrawerToggleHandler = (prevState) => {
          this.setState((prevState) => {
              return {showSideDrawer: !prevState.showSideDrawer}
          });
      }
  
      render(){
          return (
              <Aux>
                  <Toolbar 
                      isAuth={this.props.isAuthenticated}
                      drawerToggleClicked={this.sideDrawerToggleHandler} />
                  <SideDrawer 
                      isAuth={this.props.isAuthenticated}
                      open={this.state.showSideDrawer} closed={this.sideDrawerClosedHandler}/>
                  <main className={css.Content}>
                      {this.props.children}
                  </main>
              </Aux>
          );
      }
  }
  
  const mapStateToProps = state => {
      return {
          isAuthenticated: state.auth.token !== null,
      };
  };
  
  export default connect(mapStateToProps)(Layout);