Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.60 KB | None | 0 0
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import AppBar from '@material-ui/core/AppBar';
  4. import CssBaseline from '@material-ui/core/CssBaseline';
  5. import Divider from '@material-ui/core/Divider';
  6. import Drawer from '@material-ui/core/Drawer';
  7. import Hidden from '@material-ui/core/Hidden';
  8. import IconButton from '@material-ui/core/IconButton';
  9. import InboxIcon from '@material-ui/icons/MoveToInbox';
  10. import List from '@material-ui/core/List';
  11. import ListItem from '@material-ui/core/ListItem';
  12. import ListItemIcon from '@material-ui/core/ListItemIcon';
  13. import ListItemText from '@material-ui/core/ListItemText';
  14. import MailIcon from '@material-ui/icons/Mail';
  15. import MenuIcon from '@material-ui/icons/Menu';
  16. import Toolbar from '@material-ui/core/Toolbar';
  17. import Typography from '@material-ui/core/Typography';
  18. import { makeStyles, useTheme } from '@material-ui/core/styles';
  19. import { shadows } from '@material-ui/system';
  20. import {MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles';
  21.  
  22. const drawerWidth = 80;
  23.  
  24. const useStyles = makeStyles(theme => ({
  25. root: {
  26. display: 'flex',
  27. },
  28. drawer: {
  29. [theme.breakpoints.up('sm')]: {
  30. width: drawerWidth,
  31. flexShrink: 0,
  32. },
  33. },
  34. appBar: {
  35. [theme.breakpoints.up('sm')]: {
  36. width: `calc(100% - ${drawerWidth}px)`,
  37. marginLeft: drawerWidth,
  38. background:'transparent',
  39. },
  40. },
  41. menuButton: {
  42. marginRight: theme.spacing(2),
  43. [theme.breakpoints.up('sm')]: {
  44. display: 'none',
  45. },
  46. },
  47. toolbar: theme.mixins.toolbar,
  48. drawerPaper: {
  49. width: drawerWidth,
  50. background: 'transparent'
  51. },
  52. content: {
  53. flexGrow: 1,
  54. padding: theme.spacing(3),
  55. },
  56. palette: {
  57. primary: {
  58. main: '#E25781'
  59. }
  60. },
  61.  
  62. }));
  63.  
  64. function SideMenu(props) {
  65. const { container } = props;
  66. const classes = useStyles();
  67. const theme = useTheme();
  68. const [mobileOpen, setMobileOpen] = React.useState(false);
  69. const handleDrawerToggle = () => {
  70. setMobileOpen(!mobileOpen);
  71. };
  72.  
  73. const drawer = (
  74. <div>
  75.  
  76. </div>
  77. );
  78.  
  79. return (
  80. <div className='tabbar-background'>
  81. <CssBaseline />
  82. <AppBar position="fixed" className={classes.appBar} style = {{boxShadow:' 5px 3px 10px rgba(0,0,0,0.10)'}} color = 'primary'>
  83. <Toolbar>
  84. <IconButton
  85. color="inherit"
  86. aria-label="open drawer"
  87. edge="start"
  88. onClick={handleDrawerToggle}
  89. className={classes.menuButton}
  90. >
  91. <MenuIcon />
  92. </IconButton>
  93. <Typography variant="h6" noWrap>
  94. Wishes
  95. </Typography>
  96. </Toolbar>
  97. </AppBar>
  98. <nav className={classes.drawer} aria-label="mailbox folders">
  99. <Hidden smUp implementation="css">
  100. <Drawer
  101. container={container}
  102. variant="temporary"
  103. anchor={theme.direction === 'rtl' ? 'right' : 'left'}
  104. open={mobileOpen}
  105. onClose={handleDrawerToggle}
  106. classes={{
  107. paper: classes.drawerPaper,
  108. }}
  109. ModalProps={{
  110. keepMounted: true,
  111. }}
  112. >
  113. {drawer}
  114. </Drawer>
  115. </Hidden>
  116. <Hidden xsDown implementation="css">
  117. <Drawer
  118. classes={{
  119. paper: classes.drawerPaper,
  120. }}
  121. variant="permanent"
  122. open
  123. >
  124. {drawer}
  125. </Drawer>
  126. </Hidden>
  127. </nav>
  128. </div>
  129. );
  130. }
  131.  
  132.  
  133. export default SideMenu;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement