Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3694 | Rev 3713 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3694 Rev 3710
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { useNavigate } from 'react-router-dom';
2
import { useNavigate } from 'react-router-dom';
3
import { useDispatch } from 'react-redux';
3
import { useDispatch } from 'react-redux';
4
import {
4
import {
5
  Box,
5
  Box,
6
  Drawer,
6
  Drawer as MuiDrawer,
7
  List,
7
  List,
8
  ListItem,
8
  ListItem,
9
  ListItemButton,
9
  ListItemButton,
10
  ListItemIcon,
10
  ListItemIcon,
11
  ListItemText,
11
  ListItemText,
Línea 17... Línea 17...
17
import ExpandMore from '@mui/icons-material/ExpandMore';
17
import ExpandMore from '@mui/icons-material/ExpandMore';
Línea 18... Línea 18...
18
 
18
 
19
import { axios } from '@app/utils';
19
import { axios } from '@app/utils';
Línea 20... Línea 20...
20
import { addNotification } from '@app/redux/notification/notification.actions';
20
import { addNotification } from '@app/redux/notification/notification.actions';
21
 
21
 
22
function MenuDrawer({ show = false, items = [], onClose = () => {} }) {
22
export const Drawer = ({ show = false, items = [], onClose = () => {} }) => {
23
  return (
23
  return (
24
    <Drawer anchor='right' open={show} onClose={onClose}>
24
    <MuiDrawer anchor='right' open={show} onClose={onClose}>
25
      <Box role='presentation' onClick={onClose}>
25
      <Box role='presentation' onClick={onClose}>
26
        <List>
26
        <List>
27
          {items.map((item) => (
27
          {items.map((item) => (
28
            <RenderMenuItem key={item.href} item={item} onClose={onClose} />
28
            <RenderMenuItem key={item.href} item={item} onClose={onClose} />
29
          ))}
29
          ))}
30
        </List>
30
        </List>
31
      </Box>
31
      </Box>
32
    </Drawer>
32
    </MuiDrawer>
Línea 33... Línea 33...
33
  );
33
  );
34
}
34
};
35
 
35
 
36
const RenderMenuItem = ({ item, onClose }) => {
36
const RenderMenuItem = ({ item, onClose }) => {
Línea 76... Línea 76...
76
  };
76
  };
Línea 77... Línea 77...
77
 
77
 
78
  return (
78
  return (
79
    <ListItemButton
79
    <ListItemButton
80
      onClick={handleClick}
80
      onClick={handleClick}
81
      sx={{ display: 'flex', alignItems: 'center', gap: 1, width: '100%' }}
81
      sx={{ display: 'flex', alignItems: 'center', gap: 1, width: '100%', padding: 0 }}
82
    >
82
    >
83
      {Icon && (
83
      {Icon && (
84
        <ListItemIcon>
84
        <ListItemIcon>
85
          <Icon />
85
          <Icon />
Línea 136... Línea 136...
136
      </AccordionDetails>
136
      </AccordionDetails>
137
    </Accordion>
137
    </Accordion>
138
  );
138
  );
139
};
139
};
Línea 140... Línea 140...
140
 
140