Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2530 | Rev 2580 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
2482 stevensc 1
import React, { useState } from 'react'
2529 stevensc 2
import { NavLink as Link, useRouteMatch } from 'react-router-dom'
2482 stevensc 3
import { Collapse, List, ListItemButton, ListItemText } from '@mui/material'
4
import { ExpandLess, ExpandMore } from '@mui/icons-material'
5
 
6
import Widget from '@app/components/UI/Widget'
7
 
8
export default function HabitsMenu() {
2527 stevensc 9
  const { url } = useRouteMatch()
2530 stevensc 10
  const [open, setOpen] = useState(false)
2482 stevensc 11
 
12
  const handleClick = () => setOpen(!open)
13
 
14
  return (
15
    <Widget>
2531 stevensc 16
      <List
17
        sx={{
18
          '& .MuiListItemButton-root.active .MuiTypography-body1': {
19
            fontWeight: '600'
20
          }
21
        }}
22
      >
2529 stevensc 23
        <ListItemButton LinkComponent={Link} to={url}>
24
          <ListItemText primary='Habitos' />
25
        </ListItemButton>
26
 
27
        <ListItemButton LinkComponent={Link} to={`${url}/goals`}>
28
          <ListItemText primary='Metas' />
29
        </ListItemButton>
30
 
2482 stevensc 31
        <ListItemButton onClick={handleClick}>
32
          <ListItemText primary='Propósito' />
33
          {open ? <ExpandLess /> : <ExpandMore />}
34
        </ListItemButton>
35
 
36
        <Collapse in={open} timeout='auto' unmountOnExit>
37
          <List disablePadding>
2527 stevensc 38
            <ListItemButton
39
              sx={{ pl: 4 }}
40
              LinkComponent={Link}
2531 stevensc 41
              to={`${url}/purposes`}
2527 stevensc 42
            >
2531 stevensc 43
              <ListItemText primary='Propósito' />
2482 stevensc 44
            </ListItemButton>
2527 stevensc 45
            <ListItemButton
46
              sx={{ pl: 4 }}
47
              LinkComponent={Link}
2531 stevensc 48
              to={`${url}/paradigms`}
2527 stevensc 49
            >
2531 stevensc 50
              <ListItemText primary='Paradigmas' />
2482 stevensc 51
            </ListItemButton>
2527 stevensc 52
            <ListItemButton
53
              sx={{ pl: 4 }}
54
              LinkComponent={Link}
2531 stevensc 55
              to={`${url}/values`}
2527 stevensc 56
            >
2531 stevensc 57
              <ListItemText primary='Valores' />
2482 stevensc 58
            </ListItemButton>
59
          </List>
60
        </Collapse>
61
      </List>
62
    </Widget>
63
  )
64
}