Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 2652 Rev 3246
Línea 1... Línea 1...
1
import React, { useState } from 'react'
1
import React from 'react'
2
import { NavLink as Link } from 'react-router-dom'
2
import { NavLink as Link } from 'react-router-dom'
3
import {
3
import {
4
  Collapse,
-
 
5
  List,
4
  List,
-
 
5
  ListItem,
6
  ListItemButton,
6
  ListItemButton,
7
  ListItemText,
7
  ListItemIcon,
8
  styled
8
  ListItemText
9
} from '@mui/material'
9
} from '@mui/material'
10
import { ExpandLess, ExpandMore } from '@mui/icons-material'
-
 
Línea 11... Línea 10...
11
 
10
 
Línea 12... Línea -...
12
import Widget from '@app/components/UI/Widget'
-
 
13
 
-
 
14
const Navigation = styled(Widget)(({ theme }) => ({
-
 
15
  [theme.breakpoints.down('md')]: {
-
 
16
    '& > ul': {
-
 
17
      display: 'flex',
-
 
18
      '& > a': {
-
 
19
        borderRight: '1px solid var(--border-primary)'
-
 
20
      }
-
 
21
    }
-
 
22
  }
-
 
23
}))
11
import Widget from '@app/components/UI/Widget'
24
 
-
 
25
export default function HabitsMenu() {
-
 
26
  const [open, setOpen] = useState(false)
-
 
27
 
-
 
28
  const handleClick = () => setOpen(!open)
12
 
29
 
13
export default function Menu({ children }) {
30
  return (
14
  return (
31
    <>
15
    <Widget>
-
 
16
      <List
32
      <Navigation>
17
        sx={{
33
        <List
18
          position: { xs: 'fixed', md: 'relative' },
-
 
19
          display: 'flex',
34
          sx={{
20
          flexDirection: { xs: 'row', md: 'column' },
35
            '& .MuiListItemButton-root.active .MuiTypography-body1': {
21
          bottom: { xs: 0, md: 'auto' },
-
 
22
          left: { xs: 0, md: 'auto' },
36
              fontWeight: '600'
23
          width: '100%',
37
            }
24
          gap: ({ spacing }) => spacing(0.5)
38
          }}
25
        }}
39
        >
26
      >
40
          <ListItemButton LinkComponent={Link} to='/habits' exact>
27
        {children}
41
            <ListItemText primary='Habitos' />
28
      </List>
42
          </ListItemButton>
-
 
43
 
-
 
44
          <ListItemButton LinkComponent={Link} to='goals' exact>
-
 
45
            <ListItemText primary='Metas' />
29
    </Widget>
46
          </ListItemButton>
-
 
47
 
-
 
48
          <ListItemButton onClick={handleClick}>
-
 
49
            <ListItemText primary='Propósitos' />
-
 
Línea 50... Línea 30...
50
            {open ? <ExpandLess /> : <ExpandMore />}
30
  )
51
          </ListItemButton>
-
 
52
 
-
 
53
          <Collapse in={open} timeout='auto' unmountOnExit>
-
 
54
            <List disablePadding>
-
 
55
              <ListItemButton sx={{ pl: 4 }} LinkComponent={Link} to='purposes'>
31
}
56
                <ListItemText primary='Propósito' />
-
 
57
              </ListItemButton>
-
 
58
              <ListItemButton
-
 
59
                sx={{ pl: 4 }}
32
 
60
                LinkComponent={Link}
33
function MenuItem({ to, icon, label, onClick }) {
61
                to='paradigms'
34
  return (
62
              >
-
 
63
                <ListItemText primary='Paradigmas' />
35
    <ListItem>
64
              </ListItemButton>
36
      <ListItemButton LinkComponent={Link} to={to} onClick={onClick}>
65
              <ListItemButton sx={{ pl: 4 }} LinkComponent={Link} to='values'>
-
 
66
                <ListItemText primary='Valores' />
-
 
67
              </ListItemButton>
37
        <ListItemIcon>{icon}</ListItemIcon>
68
            </List>
-
 
69
          </Collapse>
-
 
70
        </List>
38
        <ListItemText primary={label} />
71
      </Navigation>
39
      </ListItemButton>
-
 
40
    </ListItem>
-
 
41
  )