|
@@ -0,0 +1,133 @@
|
|
1
|
+import * as React from 'react';
|
|
2
|
+
|
|
3
|
+import AppBar from '@mui/material/AppBar';
|
|
4
|
+import Box from '@mui/material/Box';
|
|
5
|
+import CssBaseline from '@mui/material/CssBaseline';
|
|
6
|
+import Divider from '@mui/material/Divider';
|
|
7
|
+import Drawer from '@mui/material/Drawer';
|
|
8
|
+import IconButton from '@mui/material/IconButton';
|
|
9
|
+import InboxIcon from '@mui/icons-material/MoveToInbox';
|
|
10
|
+import List from '@mui/material/List';
|
|
11
|
+import ListItem from '@mui/material/ListItem';
|
|
12
|
+import ListItemButton from '@mui/material/ListItemButton';
|
|
13
|
+import ListItemIcon from '@mui/material/ListItemIcon';
|
|
14
|
+import ListItemText from '@mui/material/ListItemText';
|
|
15
|
+import MailIcon from '@mui/icons-material/Mail';
|
|
16
|
+import MenuIcon from '@mui/icons-material/Menu';
|
|
17
|
+import Toolbar from '@mui/material/Toolbar';
|
|
18
|
+import Typography from '@mui/material/Typography';
|
|
19
|
+
|
|
20
|
+const drawerWidth = 240;
|
|
21
|
+
|
|
22
|
+export function User(props) {
|
|
23
|
+ const { window } = props;
|
|
24
|
+ const [mobileOpen, setMobileOpen] = React.useState(false);
|
|
25
|
+
|
|
26
|
+ const handleDrawerToggle = () => {
|
|
27
|
+ setMobileOpen(!mobileOpen);
|
|
28
|
+ };
|
|
29
|
+
|
|
30
|
+ const drawer = (
|
|
31
|
+ <div>
|
|
32
|
+ <Toolbar />
|
|
33
|
+ <Divider />
|
|
34
|
+ <List>
|
|
35
|
+ {['Inbox', 'Starred', 'Send email', 'Drafts'].map((text, index) => (
|
|
36
|
+ <ListItem key={text} disablePadding>
|
|
37
|
+ <ListItemButton>
|
|
38
|
+ <ListItemIcon>
|
|
39
|
+ {index % 2 === 0 ? <InboxIcon /> : <MailIcon />}
|
|
40
|
+ </ListItemIcon>
|
|
41
|
+ <ListItemText primary={text} />
|
|
42
|
+ </ListItemButton>
|
|
43
|
+ </ListItem>
|
|
44
|
+ ))}
|
|
45
|
+ </List>
|
|
46
|
+ <Divider />
|
|
47
|
+ <List>
|
|
48
|
+ {['All mail', 'Trash', 'Spam'].map((text, index) => (
|
|
49
|
+ <ListItem key={text} disablePadding>
|
|
50
|
+ <ListItemButton>
|
|
51
|
+ <ListItemIcon>
|
|
52
|
+ {index % 2 === 0 ? <InboxIcon /> : <MailIcon />}
|
|
53
|
+ </ListItemIcon>
|
|
54
|
+ <ListItemText primary={text} />
|
|
55
|
+ </ListItemButton>
|
|
56
|
+ </ListItem>
|
|
57
|
+ ))}
|
|
58
|
+ </List>
|
|
59
|
+ </div>
|
|
60
|
+ );
|
|
61
|
+
|
|
62
|
+ const container = window !== undefined ? () => window().document.body : undefined;
|
|
63
|
+
|
|
64
|
+ return (
|
|
65
|
+ <Box sx={{ display: 'flex' }}>
|
|
66
|
+ <CssBaseline />
|
|
67
|
+ <AppBar
|
|
68
|
+ position="fixed"
|
|
69
|
+ sx={{
|
|
70
|
+ width: { sm: `calc(100% - ${drawerWidth}px)` },
|
|
71
|
+ ml: { sm: `${drawerWidth}px` },
|
|
72
|
+ }}
|
|
73
|
+ >
|
|
74
|
+ <Toolbar>
|
|
75
|
+ <IconButton
|
|
76
|
+ color="inherit"
|
|
77
|
+ aria-label="open drawer"
|
|
78
|
+ edge="start"
|
|
79
|
+ onClick={handleDrawerToggle}
|
|
80
|
+ sx={{ mr: 2, display: { sm: 'none' } }}
|
|
81
|
+ >
|
|
82
|
+ <MenuIcon />
|
|
83
|
+ </IconButton>
|
|
84
|
+ <Typography variant="h6" noWrap component="div">
|
|
85
|
+ Responsive drawer
|
|
86
|
+ </Typography>
|
|
87
|
+ </Toolbar>
|
|
88
|
+ </AppBar>
|
|
89
|
+ <Box
|
|
90
|
+ component="nav"
|
|
91
|
+ sx={{ width: { sm: drawerWidth }, flexShrink: { sm: 0 } }}
|
|
92
|
+ aria-label="mailbox folders"
|
|
93
|
+ >
|
|
94
|
+ {/* The implementation can be swapped with js to avoid SEO duplication of links. */}
|
|
95
|
+ <Drawer
|
|
96
|
+ container={container}
|
|
97
|
+ variant="temporary"
|
|
98
|
+ open={mobileOpen}
|
|
99
|
+ onClose={handleDrawerToggle}
|
|
100
|
+ ModalProps={{
|
|
101
|
+ keepMounted: true, // Better open performance on mobile.
|
|
102
|
+ }}
|
|
103
|
+ sx={{
|
|
104
|
+ display: { xs: 'block', sm: 'none' },
|
|
105
|
+ '& .MuiDrawer-paper': { boxSizing: 'border-box', width: drawerWidth },
|
|
106
|
+ }}
|
|
107
|
+ >
|
|
108
|
+ {drawer}
|
|
109
|
+ </Drawer>
|
|
110
|
+ <Drawer
|
|
111
|
+ variant="permanent"
|
|
112
|
+ sx={{
|
|
113
|
+ display: { xs: 'none', sm: 'block' },
|
|
114
|
+ '& .MuiDrawer-paper': { boxSizing: 'border-box', width: drawerWidth },
|
|
115
|
+ }}
|
|
116
|
+ open
|
|
117
|
+ >
|
|
118
|
+ {drawer}
|
|
119
|
+ </Drawer>
|
|
120
|
+ </Box>
|
|
121
|
+ <Box
|
|
122
|
+ component="main"
|
|
123
|
+ sx={{ flexGrow: 1, p: 3, width: { sm: `calc(100% - ${drawerWidth}px)` } }}
|
|
124
|
+ >
|
|
125
|
+ <Toolbar />
|
|
126
|
+ <Typography paragraph>
|
|
127
|
+ Bienvenido User
|
|
128
|
+ </Typography>
|
|
129
|
+ </Box>
|
|
130
|
+ </Box>
|
|
131
|
+ );
|
|
132
|
+}
|
|
133
|
+
|