浏览代码

swappable drawer pwa

amenpunk 2 年之前
父节点
当前提交
e712f0bec8
共有 1 个文件被更改,包括 11 次插入4 次删除
  1. 11 4
      src/Components/Navigation/MenuMovil.jsx

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

1
 import * as React from 'react';
1
 import * as React from 'react';
2
 
2
 
3
-import Drawer from '@mui/material/Drawer';
4
 import { MainListItems, SecondaryListItems} from './listItems'
3
 import { MainListItems, SecondaryListItems} from './listItems'
5
 import { List, Divider } from '@mui/material';
4
 import { List, Divider } from '@mui/material';
6
 import { Logout } from '@mui/icons-material/';
5
 import { Logout } from '@mui/icons-material/';
7
 import { Nav } from 'react-bootstrap';
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
 import useAuth from '../../Auth/useAuth'
11
 import useAuth from '../../Auth/useAuth'
10
 
12
 
11
 export function MenuMovil(props) {
13
 export function MenuMovil(props) {
15
 
17
 
16
     return (
18
     return (
17
         <React.Fragment >
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
                 <List style={{ paddingTop : 64 }}>
26
                 <List style={{ paddingTop : 64 }}>
20
                     <MainListItems AppBarVisible={anchor} setAppBarVisible={() => console.log('cerrar la vision')} />
27
                     <MainListItems AppBarVisible={anchor} setAppBarVisible={() => console.log('cerrar la vision')} />
21
                 </List>
28
                 </List>
36
                         </ListItem>
43
                         </ListItem>
37
                     </Nav>
44
                     </Nav>
38
                 </List>
45
                 </List>
39
-            </Drawer>
46
+            </SwipeableDrawer>
40
         </React.Fragment>
47
         </React.Fragment>
41
     );
48
     );
42
 }
49
 }