Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1575 Rev 2641
Línea 5... Línea 5...
5
  ListItemButton,
5
  ListItemButton,
6
  ListItemText,
6
  ListItemText,
7
  Typography
7
  Typography
8
} from '@mui/material'
8
} from '@mui/material'
Línea 9... Línea 9...
9
 
9
 
Línea 10... Línea 10...
10
import WidgetWrapper from '@app/components/widgets/WidgetLayout'
10
import Widget from '../Widget'
11
 
11
 
12
const SideMenu = ({
12
const SideMenu = ({
13
  items = [],
13
  items = [],
Línea 18... Línea 18...
18
  defaultLabel = ''
18
  defaultLabel = ''
19
}) => {
19
}) => {
20
  const handleChange = (value) => onChange(value)
20
  const handleChange = (value) => onChange(value)
Línea 21... Línea 21...
21
 
21
 
-
 
22
  return (
22
  return (
23
    <Widget>
23
    <WidgetWrapper p={1}>
24
      <Widget.Body>
Línea 24... Línea 25...
24
      <Typography variant='h2'>{title}</Typography>
25
        <Typography variant='h2'>{title}</Typography>
25
 
26
 
26
      <List sx={{ mt: 1 }}>
27
        <List sx={{ mt: 1 }}>
27
        <ListItemButton
28
          <ListItemButton
28
          sx={{ py: 0, display: defaultLabel ? 'initial' : 'none' }}
29
            sx={{ py: 0, display: defaultLabel ? 'initial' : 'none' }}
29
          onClick={() => handleChange(defaultValue)}
30
            onClick={() => handleChange(defaultValue)}
30
        >
31
          >
31
          <ListItemText
32
            <ListItemText
32
            primary={defaultLabel}
33
              primary={defaultLabel}
33
            primaryTypographyProps={{
34
              primaryTypographyProps={{
34
              sx: { fontWeight: current === defaultValue ? 'bold' : 'normal' }
35
                sx: { fontWeight: current === defaultValue ? 'bold' : 'normal' }
35
            }}
36
              }}
36
          />
37
            />
37
        </ListItemButton>
38
          </ListItemButton>
-
 
39
          {items.map(({ value, name }) => (
-
 
40
            <ListItem key={value} sx={{ p: 0 }}>
38
        {items.map(({ value, name }) => (
41
              <ListItemButton
-
 
42
                sx={{ py: 0 }}
39
          <ListItem key={value} sx={{ p: 0 }}>
43
                onClick={() => handleChange(value)}
40
            <ListItemButton sx={{ py: 0 }} onClick={() => handleChange(value)}>
44
              >
41
              <ListItemText
45
                <ListItemText
42
                id={value}
46
                  id={value}
43
                primary={name}
47
                  primary={name}
44
                primaryTypographyProps={{
48
                  primaryTypographyProps={{
45
                  sx: { fontWeight: current === value ? 'bold' : 'normal' }
49
                    sx: { fontWeight: current === value ? 'bold' : 'normal' }
46
                }}
50
                  }}
47
              />
51
                />
48
            </ListItemButton>
52
              </ListItemButton>
49
          </ListItem>
53
            </ListItem>
-
 
54
          ))}
50
        ))}
55
        </List>
51
      </List>
56
      </Widget.Body>
52
    </WidgetWrapper>
57
    </Widget>
Línea 53... Línea 58...
53
  )
58
  )