text: import React from 'react';
  import PropTypes from 'prop-types';
  import AppBar from '@material-ui/core/AppBar';
  import CssBaseline from '@material-ui/core/CssBaseline';
  import Divider from '@material-ui/core/Divider';
  import Drawer from '@material-ui/core/Drawer';
  import Hidden from '@material-ui/core/Hidden';
  import IconButton from '@material-ui/core/IconButton';
  import InboxIcon from '@material-ui/icons/MoveToInbox';
  import List from '@material-ui/core/List';
  import ListItem from '@material-ui/core/ListItem';
  import ListItemIcon from '@material-ui/core/ListItemIcon';
  import ListItemText from '@material-ui/core/ListItemText';
  import MailIcon from '@material-ui/icons/Mail';
  import MenuIcon from '@material-ui/icons/Menu';
  import Toolbar from '@material-ui/core/Toolbar';
  import Typography from '@material-ui/core/Typography';
  import { makeStyles, useTheme } from '@material-ui/core/styles';
  import {Image} from "@material-ui/icons";
  import {MainView} from './MainView';
  import AccountBoxIcon from '@material-ui/icons/AccountBox';
  import AlternateEmailIcon from '@material-ui/icons/AlternateEmail';
  import ExitToAppIcon from '@material-ui/icons/ExitToApp';
  import { Login } from './Login';
  
  const drawerWidth = 240;
  
  const useStyles = makeStyles(theme => ({
    root: {
      display: 'flex',
    },
    drawer: {
      [theme.breakpoints.up('sm')]: {
        width: drawerWidth,
        flexShrink: 0,
      },
    },
    appBar: {
      [theme.breakpoints.up('sm')]: {
        width: `calc(100% - ${drawerWidth}px)`,
        marginLeft: drawerWidth,
      },
    },
    menuButton: {
      marginRight: theme.spacing(2),
      [theme.breakpoints.up('sm')]: {
        display: 'none',
      },
    },
    toolbar: theme.mixins.toolbar,
    drawerPaper: {
      width: drawerWidth,
    },
    content: {
      flexGrow: 1,
      padding: theme.spacing(3),
    },
  }));
  
  function ResponsiveDrawer(props) {
    //const { container } = props;
    const { window } = props;
    const classes = useStyles();
    //const name = localStorage.getItem('name');
    //const email = localStorage.getItem('email');
    const theme = useTheme();
    const [mobileOpen, setMobileOpen] = React.useState(false);
  
    const handleDrawerToggle = () => {
      setMobileOpen(!mobileOpen);
    };
  
    const handlerLogout = (usr) => {
      localStorage.setItem("IsLoggedIn",false);
      localStorage.removeItem("IsLoggedIn");
      localStorage.removeItem("username");
      localStorage.removeItem("email");
      handleDrawerToggle();
    }
  
    if (!localStorage.getItem("IsLoggedIn")){
      return <Login />
    }
  
    const drawer = (
      <div>
        <div className={classes.toolbar} />
        <Divider />
          <List>
              <ListItem button key={"Username"}>
                <ListItemIcon>
                  <AccountBoxIcon> </AccountBoxIcon>  
                </ListItemIcon>
                <ListItemText primary={localStorage.getItem("username")} />
              </ListItem>
              <ListItem button key={"email"}>
                <ListItemIcon>
                  <AlternateEmailIcon></AlternateEmailIcon>
                </ListItemIcon>
                <ListItemText primary={localStorage.getItem("email")} /> 
              </ListItem>
          </List>
        <Divider />
        <List>
          <ListItem button key={"Username"} onClick={(e)=> handlerLogout(e)}>
            <ListItemIcon>
              <ExitToAppIcon> </ExitToAppIcon>  
            </ListItemIcon>
            <ListItemText primary={"Logout"} />
          </ListItem>
        </List>
      </div>
    );
  
    const container = window !== undefined ? () => window().document.body : undefined;
  
    return (
      <div className={classes.root}>
        <CssBaseline />
        <AppBar position="fixed" className={classes.appBar}>
          <Toolbar>
            <IconButton
              color="inherit"
              aria-label="open drawer"
              edge="start"
              onClick={handleDrawerToggle}
              className={classes.menuButton}
            >
              <MenuIcon />
            </IconButton>
            <Typography variant="h6" noWrap>
              {"Task Manager"}  
            </Typography>
          </Toolbar>
        </AppBar>
        <nav className={classes.drawer} aria-label="mailbox folders">
          <Hidden smUp implementation="css">
            <Drawer
              container={container}
              variant="temporary"
              anchor={theme.direction === 'rtl' ? 'right' : 'left'}
              open={mobileOpen}
              onClose={handleDrawerToggle}
              classes={{
                paper: classes.drawerPaper,
              }}
              ModalProps={{
                keepMounted: true, 
              }}
            >
              {drawer}
            </Drawer>
          </Hidden>
          <Hidden xsDown implementation="css">
            <Drawer
              classes={{
                paper: classes.drawerPaper,
              }}
              variant="permanent"
              open
            >
              {drawer}
            </Drawer>
          </Hidden>
        </nav>
        <main className={classes.content}>
          <div className={classes.toolbar} />
                <br/>
                <br/>
                <MainView> </MainView>  
        </main>
      </div>
    );
  }
  
  ResponsiveDrawer.propTypes = {
    window: PropTypes.func,
  };
  
  export default ResponsiveDrawer;