Browse Source

close sessions

amenpunk 2 years ago
parent
commit
680bdb4fe6

+ 2 - 2
src/Components/Dashboard.js

@@ -1,20 +1,20 @@
1 1
 import React from 'react';
2 2
 import { ThemeProvider } from '@mui/material/styles';
3
+
3 4
 import { 
4 5
     Menu,MenuItem,Container,Avatar, Badge,IconButton,Divider,
5 6
     Typography, List, Toolbar, Box, CssBaseline,useMediaQuery as Size,
6 7
 } from '@mui/material'
8
+
7 9
 import {
8 10
     Mail as MailIcon, Notifications as NotificationsIcon, Fullscreen as FullscreenIcon,
9 11
     Menu as MenuIcon,
10 12
 } from '@mui/icons-material'
11 13
 
12 14
 import useAuth from '../Auth/useAuth';
13
-
14 15
 import Logo from '../Images/logo.png';
15 16
 import ProfilePicture from '../Images/man.png';
16 17
 
17
-
18 18
 import { Outlet, useNavigate} from "react-router-dom";
19 19
 import { MenuMovil } from '../Components/Navigation/MenuMovil';
20 20
 import Footer from "../Components/Footer";

+ 32 - 12
src/Components/Navigation/MenuMovil.jsx

@@ -1,22 +1,42 @@
1 1
 import * as React from 'react';
2 2
 
3 3
 import Drawer from '@mui/material/Drawer';
4
-import { MainListItems } from './MainListItems'
4
+import { MainListItems, SecondaryListItems} from './listItems'
5
+import { List, Divider } from '@mui/material';
6
+import { Logout } from '@mui/icons-material/';
7
+import { Nav } from 'react-bootstrap';
8
+import { ListItem, ListItemIcon,ListItemText} from '@mui/material/'
9
+import useAuth from '../../Auth/useAuth'
5 10
 
6 11
 export function MenuMovil(props) {
7 12
 
8 13
     let { anchor } = props;
14
+    const auth = useAuth();
15
+
9 16
     return (
10
-        <div>
11
-            <React.Fragment >
12
-                <Drawer
13
-                    anchor="left"
14
-                    open={anchor} >
15
-                    <div  style={{ paddingTop : 15}}>
16
-                        <MainListItems/>
17
-                    </div>
18
-                </Drawer>
19
-            </React.Fragment>
20
-        </div>
17
+        <React.Fragment >
18
+            <Drawer anchor="left" open={anchor} sx={{ width : 10 }} >
19
+                <List style={{ paddingTop : 64 }}>
20
+                    <MainListItems AppBarVisible={anchor} setAppBarVisible={() => console.log('cerrar la vision')} />
21
+                </List>
22
+                <Divider />
23
+                <List>
24
+                    {SecondaryListItems}
25
+                </List>
26
+                <Divider />
27
+                <List>
28
+                    <Nav onClick ={auth.logout}>
29
+                        <ListItem>
30
+                            <ListItemIcon>
31
+                                <Logout/>
32
+                            </ListItemIcon>
33
+                            <ListItemText>
34
+                                Cerrar sesion
35
+                            </ListItemText>
36
+                        </ListItem>
37
+                    </Nav>
38
+                </List>
39
+            </Drawer>
40
+        </React.Fragment>
21 41
     );
22 42
 }

+ 1 - 1
src/Components/Navigation/listItems.js

@@ -1,5 +1,4 @@
1 1
 import * as React from 'react';
2
-
3 2
 import { Nav } from 'react-bootstrap';
4 3
 
5 4
 import { 
@@ -118,3 +117,4 @@ export const SecondaryListItems = (
118 117
         <NavItem icon={<SupportAgent/>} title="Asistencia Técnica" route="/worktree" />
119 118
     </Nav>
120 119
 );
120
+