Browse Source

logincd dash route

amenpunk 2 years ago
parent
commit
0d1f6bed03
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/Components/User.jsx

+ 8 - 0
src/Components/User.jsx

14
 import ListItemText from '@mui/material/ListItemText';
14
 import ListItemText from '@mui/material/ListItemText';
15
 import MailIcon from '@mui/icons-material/Mail';
15
 import MailIcon from '@mui/icons-material/Mail';
16
 import MenuIcon from '@mui/icons-material/Menu';
16
 import MenuIcon from '@mui/icons-material/Menu';
17
+import Button from '@mui/material/Button';
17
 import Toolbar from '@mui/material/Toolbar';
18
 import Toolbar from '@mui/material/Toolbar';
18
 import Typography from '@mui/material/Typography';
19
 import Typography from '@mui/material/Typography';
20
+import useAuth from '../Auth/useAuth';
19
 
21
 
20
 const drawerWidth = 240;
22
 const drawerWidth = 240;
21
 
23
 
22
 export function User(props) {
24
 export function User(props) {
25
+
23
     const { window } = props;
26
     const { window } = props;
24
     const [mobileOpen, setMobileOpen] = React.useState(false);
27
     const [mobileOpen, setMobileOpen] = React.useState(false);
25
 
28
 
27
         setMobileOpen(!mobileOpen);
30
         setMobileOpen(!mobileOpen);
28
     };
31
     };
29
 
32
 
33
+    const auth = useAuth();
34
+
30
     const drawer = (
35
     const drawer = (
31
         <div>
36
         <div>
32
             <Toolbar />
37
             <Toolbar />
126
                 <Typography paragraph>
131
                 <Typography paragraph>
127
                     Bienvenido User
132
                     Bienvenido User
128
                 </Typography>
133
                 </Typography>
134
+                <div>
135
+                    <Button onClick={auth.logout} variant="contained">Cerrar Session</Button>
136
+                </div>
129
             </Box>
137
             </Box>
130
         </Box>
138
         </Box>
131
     );
139
     );