Sfoglia il codice sorgente

swappable drawer pwa

amenpunk 2 anni fa
parent
commit
e712f0bec8
1 ha cambiato i file con 11 aggiunte e 4 eliminazioni
  1. 11 4
      src/Components/Navigation/MenuMovil.jsx

+ 11 - 4
src/Components/Navigation/MenuMovil.jsx

@@ -1,11 +1,13 @@
1 1
 import * as React from 'react';
2 2
 
3
-import Drawer from '@mui/material/Drawer';
4 3
 import { MainListItems, SecondaryListItems} from './listItems'
5 4
 import { List, Divider } from '@mui/material';
6 5
 import { Logout } from '@mui/icons-material/';
7 6
 import { Nav } from 'react-bootstrap';
8
-import { ListItem, ListItemIcon,ListItemText} from '@mui/material/'
7
+import { 
8
+    ListItem, ListItemIcon,ListItemText,
9
+    SwipeableDrawer
10
+} from '@mui/material/'
9 11
 import useAuth from '../../Auth/useAuth'
10 12
 
11 13
 export function MenuMovil(props) {
@@ -15,7 +17,12 @@ export function MenuMovil(props) {
15 17
 
16 18
     return (
17 19
         <React.Fragment >
18
-            <Drawer anchor="left" open={anchor} sx={{ width : 10 }} >
20
+            <SwipeableDrawer anchor="left" open={anchor} 
21
+                sx={{
22
+                    '& .MuiDrawer-paper': {
23
+                        width : '50%'
24
+                    }
25
+                }}>
19 26
                 <List style={{ paddingTop : 64 }}>
20 27
                     <MainListItems AppBarVisible={anchor} setAppBarVisible={() => console.log('cerrar la vision')} />
21 28
                 </List>
@@ -36,7 +43,7 @@ export function MenuMovil(props) {
36 43
                         </ListItem>
37 44
                     </Nav>
38 45
                 </List>
39
-            </Drawer>
46
+            </SwipeableDrawer>
40 47
         </React.Fragment>
41 48
     );
42 49
 }