Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2529 | Rev 2531 | 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>
16
      <List>
2529 stevensc 17
        <ListItemButton LinkComponent={Link} to={url}>
18
          <ListItemText primary='Habitos' />
19
        </ListItemButton>
20
 
21
        <ListItemButton LinkComponent={Link} to={`${url}/goals`}>
22
          <ListItemText primary='Metas' />
23
        </ListItemButton>
24
 
2482 stevensc 25
        <ListItemButton onClick={handleClick}>
26
          <ListItemText primary='Propósito' />
27
          {open ? <ExpandLess /> : <ExpandMore />}
28
        </ListItemButton>
29
 
30
        <Collapse in={open} timeout='auto' unmountOnExit>
31
          <List disablePadding>
2527 stevensc 32
            <ListItemButton
33
              sx={{ pl: 4 }}
34
              LinkComponent={Link}
35
              to={`${url}/paradigms`}
36
            >
2482 stevensc 37
              <ListItemText primary='Paradigmas' />
38
            </ListItemButton>
2527 stevensc 39
            <ListItemButton
40
              sx={{ pl: 4 }}
41
              LinkComponent={Link}
42
              to={`${url}/values`}
43
            >
2482 stevensc 44
              <ListItemText primary='Valores' />
45
            </ListItemButton>
2527 stevensc 46
            <ListItemButton
47
              sx={{ pl: 4 }}
48
              LinkComponent={Link}
49
              to={`${url}/purposes`}
50
            >
2482 stevensc 51
              <ListItemText primary='Propósito' />
52
            </ListItemButton>
53
          </List>
54
        </Collapse>
55
      </List>
56
    </Widget>
57
  )
58
}