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