|
@@ -14,194 +14,218 @@ import Container from '@mui/material/Container';
|
14
|
14
|
import Grid from '@mui/material/Grid';
|
15
|
15
|
import Paper from '@mui/material/Paper';
|
16
|
16
|
import Link from '@mui/material/Link';
|
|
17
|
+import Avatar from '@mui/material/Avatar';
|
|
18
|
+
|
|
19
|
+
|
17
|
20
|
import MenuIcon from '@mui/icons-material/Menu';
|
18
|
21
|
import ChevronLeftIcon from '@mui/icons-material/ChevronLeft';
|
19
|
22
|
import NotificationsIcon from '@mui/icons-material/Notifications';
|
20
|
23
|
import { mainListItems, secondaryListItems } from './listItems';
|
|
24
|
+import AccountCircle from '@mui/icons-material/AccountCircle';
|
21
|
25
|
// import Chart from './Chart';
|
22
|
26
|
import Deposits from './Deposits';
|
23
|
27
|
import Orders from './Orders';
|
24
|
28
|
|
|
29
|
+
|
|
30
|
+import MailIcon from '@mui/icons-material/Mail';
|
|
31
|
+
|
|
32
|
+import Logo from '../Images/logo.png';
|
|
33
|
+import ProfilePicture from '../Images/man.png';
|
|
34
|
+
|
|
35
|
+
|
25
|
36
|
function Copyright(props) {
|
26
|
|
- return (
|
27
|
|
- <Typography variant="body2" color="text.secondary" align="center" {...props}>
|
28
|
|
- {'Copyright © '}
|
29
|
|
- <Link color="inherit" href="https://mui.com/">
|
30
|
|
- Your Website
|
31
|
|
- </Link>{' '}
|
32
|
|
- {new Date().getFullYear()}
|
33
|
|
- {'.'}
|
34
|
|
- </Typography>
|
35
|
|
- );
|
|
37
|
+ return (
|
|
38
|
+ <Typography variant="body2" color="text.secondary" align="center" {...props}>
|
|
39
|
+ {'Copyright © '}
|
|
40
|
+ <Link color="inherit" href="https://mui.com/">
|
|
41
|
+ Your Website
|
|
42
|
+ </Link>{' '}
|
|
43
|
+ {new Date().getFullYear()}
|
|
44
|
+ {'.'}
|
|
45
|
+ </Typography>
|
|
46
|
+ );
|
36
|
47
|
}
|
37
|
48
|
|
38
|
49
|
const drawerWidth = 240;
|
39
|
50
|
|
40
|
51
|
const AppBar = styled(MuiAppBar, {
|
41
|
|
- shouldForwardProp: (prop) => prop !== 'open',
|
|
52
|
+ shouldForwardProp: (prop) => prop !== 'open',
|
42
|
53
|
})(({ theme, open }) => ({
|
43
|
|
- zIndex: theme.zIndex.drawer + 1,
|
44
|
|
- transition: theme.transitions.create(['width', 'margin'], {
|
45
|
|
- easing: theme.transitions.easing.sharp,
|
46
|
|
- duration: theme.transitions.duration.leavingScreen,
|
47
|
|
- }),
|
48
|
|
- ...(open && {
|
49
|
|
- marginLeft: drawerWidth,
|
50
|
|
- width: `calc(100% - ${drawerWidth}px)`,
|
|
54
|
+ zIndex: theme.zIndex.drawer + 1,
|
51
|
55
|
transition: theme.transitions.create(['width', 'margin'], {
|
52
|
|
- easing: theme.transitions.easing.sharp,
|
53
|
|
- duration: theme.transitions.duration.enteringScreen,
|
|
56
|
+ easing: theme.transitions.easing.sharp,
|
|
57
|
+ duration: theme.transitions.duration.leavingScreen,
|
|
58
|
+ }),
|
|
59
|
+ ...(open && {
|
|
60
|
+ marginLeft: drawerWidth,
|
|
61
|
+ width: `calc(100% - ${drawerWidth}px)`,
|
|
62
|
+ transition: theme.transitions.create(['width', 'margin'], {
|
|
63
|
+ easing: theme.transitions.easing.sharp,
|
|
64
|
+ duration: theme.transitions.duration.enteringScreen,
|
|
65
|
+ }),
|
54
|
66
|
}),
|
55
|
|
- }),
|
56
|
67
|
}));
|
57
|
68
|
|
58
|
69
|
const Drawer = styled(MuiDrawer, { shouldForwardProp: (prop) => prop !== 'open' })(
|
59
|
|
- ({ theme, open }) => ({
|
60
|
|
- '& .MuiDrawer-paper': {
|
61
|
|
- position: 'relative',
|
62
|
|
- whiteSpace: 'nowrap',
|
63
|
|
- width: drawerWidth,
|
64
|
|
- transition: theme.transitions.create('width', {
|
65
|
|
- easing: theme.transitions.easing.sharp,
|
66
|
|
- duration: theme.transitions.duration.enteringScreen,
|
67
|
|
- }),
|
68
|
|
- boxSizing: 'border-box',
|
69
|
|
- ...(!open && {
|
70
|
|
- overflowX: 'hidden',
|
71
|
|
- transition: theme.transitions.create('width', {
|
72
|
|
- easing: theme.transitions.easing.sharp,
|
73
|
|
- duration: theme.transitions.duration.leavingScreen,
|
74
|
|
- }),
|
75
|
|
- width: theme.spacing(7),
|
76
|
|
- [theme.breakpoints.up('sm')]: {
|
77
|
|
- width: theme.spacing(9),
|
|
70
|
+ ({ theme, open }) => ({
|
|
71
|
+ '& .MuiDrawer-paper': {
|
|
72
|
+ position: 'relative',
|
|
73
|
+ whiteSpace: 'nowrap',
|
|
74
|
+ width: drawerWidth,
|
|
75
|
+ transition: theme.transitions.create('width', {
|
|
76
|
+ easing: theme.transitions.easing.sharp,
|
|
77
|
+ duration: theme.transitions.duration.enteringScreen,
|
|
78
|
+ }),
|
|
79
|
+ boxSizing: 'border-box',
|
|
80
|
+ ...(!open && {
|
|
81
|
+ overflowX: 'hidden',
|
|
82
|
+ transition: theme.transitions.create('width', {
|
|
83
|
+ easing: theme.transitions.easing.sharp,
|
|
84
|
+ duration: theme.transitions.duration.leavingScreen,
|
|
85
|
+ }),
|
|
86
|
+ width: theme.spacing(7),
|
|
87
|
+ [theme.breakpoints.up('sm')]: {
|
|
88
|
+ width: theme.spacing(9),
|
|
89
|
+ },
|
|
90
|
+ }),
|
78
|
91
|
},
|
79
|
|
- }),
|
80
|
|
- },
|
81
|
|
- }),
|
|
92
|
+ }),
|
82
|
93
|
);
|
83
|
94
|
|
84
|
95
|
const mdTheme = createTheme();
|
85
|
96
|
|
86
|
97
|
function DashboardContent() {
|
87
|
|
- const [open, setOpen] = React.useState(true);
|
88
|
|
- const toggleDrawer = () => {
|
89
|
|
- setOpen(!open);
|
90
|
|
- };
|
91
|
|
-
|
92
|
|
- return (
|
93
|
|
- <ThemeProvider theme={mdTheme}>
|
94
|
|
- <Box sx={{ display: 'flex' }}>
|
95
|
|
- <CssBaseline />
|
96
|
|
- <AppBar position="absolute" open={open}>
|
97
|
|
- <Toolbar
|
98
|
|
- sx={{
|
99
|
|
- pr: '24px', // keep right padding when drawer closed
|
100
|
|
- }}
|
101
|
|
- >
|
102
|
|
- <IconButton
|
103
|
|
- edge="start"
|
104
|
|
- color="inherit"
|
105
|
|
- aria-label="open drawer"
|
106
|
|
- onClick={toggleDrawer}
|
107
|
|
- sx={{
|
108
|
|
- marginRight: '36px',
|
109
|
|
- ...(open && { display: 'none' }),
|
110
|
|
- }}
|
111
|
|
- >
|
112
|
|
- <MenuIcon />
|
113
|
|
- </IconButton>
|
114
|
|
- <Typography
|
115
|
|
- component="h1"
|
116
|
|
- variant="h6"
|
117
|
|
- color="inherit"
|
118
|
|
- noWrap
|
119
|
|
- sx={{ flexGrow: 1 }}
|
120
|
|
- >
|
121
|
|
- Dashboard
|
122
|
|
- </Typography>
|
123
|
|
- <IconButton color="inherit">
|
124
|
|
- <Badge badgeContent={4} color="secondary">
|
125
|
|
- <NotificationsIcon />
|
126
|
|
- </Badge>
|
127
|
|
- </IconButton>
|
128
|
|
- </Toolbar>
|
129
|
|
- </AppBar>
|
130
|
|
- <Drawer variant="permanent" open={open}>
|
131
|
|
- <Toolbar
|
132
|
|
- sx={{
|
133
|
|
- display: 'flex',
|
134
|
|
- alignItems: 'center',
|
135
|
|
- justifyContent: 'flex-end',
|
136
|
|
- px: [1],
|
137
|
|
- }}
|
138
|
|
- >
|
139
|
|
- <IconButton onClick={toggleDrawer}>
|
140
|
|
- <ChevronLeftIcon />
|
141
|
|
- </IconButton>
|
142
|
|
- </Toolbar>
|
143
|
|
- <Divider />
|
144
|
|
- <List>{mainListItems}</List>
|
145
|
|
- <Divider />
|
146
|
|
- <List>{secondaryListItems}</List>
|
147
|
|
- </Drawer>
|
148
|
|
- <Box
|
149
|
|
- component="main"
|
150
|
|
- sx={{
|
151
|
|
- backgroundColor: (theme) =>
|
152
|
|
- theme.palette.mode === 'light'
|
153
|
|
- ? theme.palette.grey[100]
|
154
|
|
- : theme.palette.grey[900],
|
155
|
|
- flexGrow: 1,
|
156
|
|
- height: '100vh',
|
157
|
|
- overflow: 'auto',
|
158
|
|
- }}
|
159
|
|
- >
|
160
|
|
- <Toolbar />
|
161
|
|
- <Container maxWidth="lg" sx={{ mt: 4, mb: 4 }}>
|
162
|
|
- <Grid container spacing={3}>
|
163
|
|
- {/* Chart */}
|
164
|
|
- <Grid item xs={12} md={8} lg={9}>
|
165
|
|
- <Paper
|
166
|
|
- sx={{
|
167
|
|
- p: 2,
|
168
|
|
- display: 'flex',
|
169
|
|
- flexDirection: 'column',
|
170
|
|
- height: 240,
|
171
|
|
- }}
|
172
|
|
- >
|
173
|
|
- {/* <Chart /> */}
|
174
|
|
- </Paper>
|
175
|
|
- </Grid>
|
176
|
|
- {/* Recent Deposits */}
|
177
|
|
- <Grid item xs={12} md={4} lg={3}>
|
178
|
|
- <Paper
|
179
|
|
- sx={{
|
180
|
|
- p: 2,
|
181
|
|
- display: 'flex',
|
182
|
|
- flexDirection: 'column',
|
183
|
|
- height: 240,
|
184
|
|
- }}
|
|
98
|
+ const [open, setOpen] = React.useState(true);
|
|
99
|
+ const toggleDrawer = () => {
|
|
100
|
+ setOpen(!open);
|
|
101
|
+ };
|
|
102
|
+
|
|
103
|
+ return (
|
|
104
|
+ <ThemeProvider theme={mdTheme}>
|
|
105
|
+ <Box sx={{ display: 'flex' }}>
|
|
106
|
+ <CssBaseline />
|
|
107
|
+ <AppBar style={{ backgroundColor : '#fff' }} position="absolute" open={open}>
|
|
108
|
+ <Toolbar sx={{ pr: '24px' }} >
|
|
109
|
+
|
|
110
|
+ <IconButton style={{ color : '#212529' }} edge="start" color="inherit" aria-label="open drawer" onClick={toggleDrawer} sx={{ marginRight: '36px', ...(open && { display: 'none' }), }} >
|
|
111
|
+ <MenuIcon />
|
|
112
|
+ </IconButton>
|
|
113
|
+
|
|
114
|
+ <Typography component="h1" variant="h6" color="inherit" noWrap sx={{ flexGrow: 1 }} >
|
|
115
|
+ <div className="sidebar-header">
|
|
116
|
+ <div className="width_img">
|
|
117
|
+ <img src={Logo} alt=""/>
|
|
118
|
+ </div>
|
|
119
|
+ </div>
|
|
120
|
+ </Typography>
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+ <Box sx={{ display: { xs: 'none', md: 'flex' } }}>
|
|
124
|
+ <IconButton size="large" aria-label="show 4 new mails" color="inherit">
|
|
125
|
+ <Badge badgeContent={4} color="error">
|
|
126
|
+ <MailIcon style={{ color : '#212529' }} />
|
|
127
|
+ </Badge>
|
|
128
|
+ </IconButton>
|
|
129
|
+ <IconButton
|
|
130
|
+ size="large"
|
|
131
|
+ aria-label="show 17 new notifications"
|
|
132
|
+ color="inherit"
|
|
133
|
+ >
|
|
134
|
+ <Badge badgeContent={17} color="error">
|
|
135
|
+ <NotificationsIcon style={{ color : '#212529' }}/>
|
|
136
|
+ </Badge>
|
|
137
|
+ </IconButton>
|
|
138
|
+ <IconButton
|
|
139
|
+ size="small"
|
|
140
|
+ edge="end"
|
|
141
|
+ aria-label="account of current user"
|
|
142
|
+ aria-haspopup="true"
|
|
143
|
+ onClick={ () => console.log('show menu') }
|
|
144
|
+ color="inherit"
|
|
145
|
+ >
|
|
146
|
+ <Avatar alt="Cindy Baker" src={ProfilePicture} />
|
|
147
|
+
|
|
148
|
+ </IconButton>
|
|
149
|
+ </Box>
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+ </Toolbar>
|
|
154
|
+ </AppBar>
|
|
155
|
+ <Drawer variant="permanent" open={open}>
|
|
156
|
+ <Toolbar
|
|
157
|
+ sx={{
|
|
158
|
+ display: 'flex',
|
|
159
|
+ alignItems: 'center',
|
|
160
|
+ justifyContent: 'flex-end',
|
|
161
|
+ px: [1],
|
|
162
|
+ }} >
|
|
163
|
+ <IconButton onClick={toggleDrawer}>
|
|
164
|
+ <ChevronLeftIcon />
|
|
165
|
+ </IconButton>
|
|
166
|
+ </Toolbar>
|
|
167
|
+ <Divider />
|
|
168
|
+ <List>{mainListItems}</List>
|
|
169
|
+ <Divider />
|
|
170
|
+ <List>{secondaryListItems}</List>
|
|
171
|
+ </Drawer>
|
|
172
|
+ <Box
|
|
173
|
+ component="main"
|
|
174
|
+ sx={{
|
|
175
|
+ backgroundColor: (theme) =>
|
|
176
|
+ theme.palette.mode === 'light'
|
|
177
|
+ ? theme.palette.grey[100]
|
|
178
|
+ : theme.palette.grey[900],
|
|
179
|
+ flexGrow: 1,
|
|
180
|
+ height: '100vh',
|
|
181
|
+ overflow: 'auto',
|
|
182
|
+ }}
|
185
|
183
|
>
|
186
|
|
- <Deposits />
|
187
|
|
- </Paper>
|
188
|
|
- </Grid>
|
189
|
|
- {/* Recent Orders */}
|
190
|
|
- <Grid item xs={12}>
|
191
|
|
- <Paper sx={{ p: 2, display: 'flex', flexDirection: 'column' }}>
|
192
|
|
- <Orders />
|
193
|
|
- </Paper>
|
194
|
|
- </Grid>
|
195
|
|
- </Grid>
|
196
|
|
- <Copyright sx={{ pt: 4 }} />
|
197
|
|
- </Container>
|
198
|
|
- </Box>
|
199
|
|
- </Box>
|
200
|
|
- </ThemeProvider>
|
201
|
|
- );
|
|
184
|
+ <Toolbar />
|
|
185
|
+ <Container maxWidth="lg" sx={{ mt: 4, mb: 4 }}>
|
|
186
|
+ <Grid container spacing={3}>
|
|
187
|
+ {/* Chart */}
|
|
188
|
+ <Grid item xs={12} md={8} lg={9}>
|
|
189
|
+ <Paper
|
|
190
|
+ sx={{
|
|
191
|
+ p: 2,
|
|
192
|
+ display: 'flex',
|
|
193
|
+ flexDirection: 'column',
|
|
194
|
+ height: 240,
|
|
195
|
+ }}
|
|
196
|
+ >
|
|
197
|
+ {/* <Chart /> */}
|
|
198
|
+ </Paper>
|
|
199
|
+ </Grid>
|
|
200
|
+ {/* Recent Deposits */}
|
|
201
|
+ <Grid item xs={12} md={4} lg={3}>
|
|
202
|
+ <Paper
|
|
203
|
+ sx={{
|
|
204
|
+ p: 2,
|
|
205
|
+ display: 'flex',
|
|
206
|
+ flexDirection: 'column',
|
|
207
|
+ height: 240,
|
|
208
|
+ }}
|
|
209
|
+ >
|
|
210
|
+ <Deposits />
|
|
211
|
+ </Paper>
|
|
212
|
+ </Grid>
|
|
213
|
+ {/* Recent Orders */}
|
|
214
|
+ <Grid item xs={12}>
|
|
215
|
+ <Paper sx={{ p: 2, display: 'flex', flexDirection: 'column' }}>
|
|
216
|
+ <Orders />
|
|
217
|
+ </Paper>
|
|
218
|
+ </Grid>
|
|
219
|
+ </Grid>
|
|
220
|
+ <Copyright sx={{ pt: 4 }} />
|
|
221
|
+ </Container>
|
|
222
|
+ </Box>
|
|
223
|
+ </Box>
|
|
224
|
+ </ThemeProvider>
|
|
225
|
+ );
|
202
|
226
|
}
|
203
|
227
|
|
204
|
228
|
export default function Dashboard() {
|
205
|
|
- return <DashboardContent />;
|
|
229
|
+ return <DashboardContent />;
|
206
|
230
|
}
|
207
|
231
|
|