Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 4779 Rev 4780
Línea 11... Línea 11...
11
import AccordionDetails from '@mui/material/AccordionDetails';
11
import AccordionDetails from '@mui/material/AccordionDetails';
12
import Link from '@mui/material/Link';
12
import Link from '@mui/material/Link';
13
import Typography from '@mui/material/Typography';
13
import Typography from '@mui/material/Typography';
14
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
14
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
Línea 15... Línea 15...
15
 
15
 
Línea 16... Línea 16...
16
function MenuDrawer({ isOpen = false, items = [], icons=[], closeDrawer = () => { } }) {
16
function MenuDrawer({ isOpen = false, items = [], icons = [], closeDrawer = () => { } }) {
17
 
-
 
18
    return (
-
 
19
        <Drawer
-
 
20
            anchor='right'
17
 
21
            open={isOpen}
-
 
22
            onClose={closeDrawer}
-
 
23
        >
-
 
24
            <Box
18
    return (
25
                sx={{ width: 250 }}
-
 
26
                role="presentation"
19
        <Drawer anchor='right' open={isOpen} onClose={closeDrawer}>
27
            >
20
            <Box sx={{ width: 250, padding: '1rem' }} role="presentation">
28
                <List>
21
                <List>
29
                    {items.map((navItem, index) => {
22
                    {items.map((navItem, index) => {
30
                        return (
23
                        return (
Línea 47... Línea 40...
47
const Item = ({ Icon, title, url, childs = [] }) => {
40
const Item = ({ Icon, title, url, childs = [] }) => {
48
    return (
41
    return (
49
        <ListItem disablePadding>
42
        <ListItem disablePadding>
50
            {!childs.length
43
            {!childs.length
51
                ?
44
                ?
52
                <Link href={url}>
45
                <Link href={url} display='flex' gap='.5rem'>
53
                    <ListItemIcon>
46
                    <ListItemIcon>
54
                        {Icon && <Icon />}
47
                        {Icon && <Icon />}
55
                    </ListItemIcon>
48
                    </ListItemIcon>
56
                    <ListItemText primary={title} />
49
                    <ListItemText primary={title} />
57
                </Link>
50
                </Link>
58
                :
51
                :
59
                <Accordion>
52
                <Accordion sx={{ border: 'none', width: '100%' }}>
60
                    <AccordionSummary
53
                    <AccordionSummary
61
                        expandIcon={<ExpandMoreIcon />}
54
                        expandIcon={<ExpandMoreIcon />}
62
                        aria-controls="panel1a-content"
55
                        aria-controls="panel1a-content"
63
                        id="panel1a-header"
56
                        id="panel1a-header"
-
 
57
                        sx={{ minHeight: 'auto' }}
64
                    >
58
                    >
65
                        <Typography>Accordion 1</Typography>
59
                        <Typography margin='1rem 0'>{title}</Typography>
66
                    </AccordionSummary>
60
                    </AccordionSummary>
67
                    <AccordionDetails>
61
                    <AccordionDetails>
68
                        {childs.map((child, index) => {
62
                        {childs.map((child, index) => {
69
                            return (
63
                            return (
70
                                <Link key={index} href={child.href}>
64
                                <Link key={index} href={child.href}>