|
@@ -1,11 +1,13 @@
|
1
|
1
|
import * as React from 'react';
|
|
2
|
+import ListItemButton from '@mui/material/ListItemButton';
|
2
|
3
|
import ListItem from '@mui/material/ListItem';
|
|
4
|
+import List from '@mui/material/List';
|
|
5
|
+
|
3
|
6
|
import ListItemIcon from '@mui/material/ListItemIcon';
|
4
|
7
|
import ListItemText from '@mui/material/ListItemText';
|
5
|
8
|
import ListSubheader from '@mui/material/ListSubheader';
|
6
|
9
|
|
7
|
10
|
import { Nav } from 'react-bootstrap';
|
8
|
|
-import { NavLink } from 'react-router-dom'
|
9
|
11
|
|
10
|
12
|
import HomeIcon from '@mui/icons-material/Home'
|
11
|
13
|
import WorkIcon from '@mui/icons-material/Work';
|
|
@@ -21,42 +23,78 @@ import OndemandVideoIcon from '@mui/icons-material/OndemandVideo';
|
21
|
23
|
import StarIcon from '@mui/icons-material/Star';
|
22
|
24
|
import SupportAgentIcon from '@mui/icons-material/SupportAgent';
|
23
|
25
|
|
|
26
|
+import NavStyle from './NavStyle'
|
|
27
|
+
|
|
28
|
+
|
24
|
29
|
function Item (props) {
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+ function change (event){
|
|
33
|
+ props.change(event, props.index)
|
|
34
|
+ }
|
|
35
|
+ let isOn = props.selected === props.index
|
|
36
|
+
|
|
37
|
+ //.css-10oikv1-MuiButtonBase-root-MuiListItem-root.Mui-selected
|
25
|
38
|
return(
|
26
|
|
- <ListItem button>
|
|
39
|
+ <ListItem
|
|
40
|
+ sx={{
|
|
41
|
+ color : '#25344f',
|
|
42
|
+ '& .MuiButtonBase-selected' :{
|
|
43
|
+ color : '#121212',
|
|
44
|
+ backgroundColor : '#101010'
|
|
45
|
+ }
|
|
46
|
+ }}
|
|
47
|
+ selected={isOn}
|
|
48
|
+ onClick={change}
|
|
49
|
+ button
|
|
50
|
+ >
|
27
|
51
|
<ListItemIcon>
|
28
|
52
|
{props.icon}
|
29
|
53
|
</ListItemIcon>
|
30
|
|
- <Nav.Item>
|
31
|
|
- <NavLink to={props.route}>
|
32
|
|
- <ListItemText primary={props.title} />
|
33
|
|
- </NavLink>
|
34
|
|
- </Nav.Item>
|
|
54
|
+ <ListItemText
|
|
55
|
+ sx={{
|
|
56
|
+ fontSize: 12,
|
|
57
|
+ ' .css-10hburv-MuiTypography-root' : {
|
|
58
|
+ fontSize : '.875rem'
|
|
59
|
+ },
|
|
60
|
+ }}
|
|
61
|
+ primary={props.title}
|
|
62
|
+ />
|
35
|
63
|
</ListItem>
|
36
|
64
|
)
|
37
|
65
|
}
|
38
|
66
|
|
39
|
67
|
|
40
|
|
-export const mainListItems = (
|
41
|
|
- <Nav>
|
42
|
|
- <ListSubheader inset>MENÚ</ListSubheader>
|
43
|
|
- <Item icon={<HomeIcon/>} title="Inicio" route="/home" />
|
44
|
|
- <Item icon={<WorkIcon/>} title="Puestos" route="/work" />
|
45
|
|
- <Item icon={<VisibilityOffIcon/>} title="Contraseñas" route="/work" />
|
46
|
|
- <Item icon={<PeopleAltIcon/>} title="Expedientes" route="/work" />
|
47
|
|
- <Item icon={<EqualizerIcon/>} title="Resultados" route="/work" />
|
48
|
|
- <Item icon={<FingerprintIcon/>} title="Pruebas" route="/work" />
|
49
|
|
- <Item icon={<MiscellaneousServicesIcon/>} title="Configuraciones" route="/work" />
|
50
|
|
- <Item icon={<HistoryIcon/>} title="Historial" route="/work" />
|
|
68
|
+export const MainListItems = () => {
|
|
69
|
+
|
|
70
|
+ const [selectedIndex, setSelectedIndex] = React.useState(1);
|
51
|
71
|
|
52
|
|
- </Nav>
|
53
|
|
-);
|
|
72
|
+
|
|
73
|
+ const handleListItemClick = (event, index) => {
|
|
74
|
+ setSelectedIndex(index);
|
|
75
|
+ };
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+ return(
|
|
79
|
+ <List>
|
|
80
|
+ <ListSubheader inset>MENÚ</ListSubheader>
|
|
81
|
+ <Item icon={<HomeIcon/>} index={0} selected={selectedIndex} change={handleListItemClick} title="Inicio" route="/dashboard" />
|
|
82
|
+ <Item icon={<WorkIcon/>} index={1} selected={selectedIndex} change={handleListItemClick} title="Puestos" route="/puestos" />
|
|
83
|
+ <Item icon={<VisibilityOffIcon/>} selected={selectedIndex} change={handleListItemClick} index={2} title="Contraseñas" route="/contrasenas" />
|
|
84
|
+ <Item icon={<PeopleAltIcon/>} selected={selectedIndex} change={handleListItemClick} index={3} title="Expedientes" route="/expedientes" />
|
|
85
|
+ <Item icon={<EqualizerIcon/>} selected={selectedIndex} change={handleListItemClick} index={4} title="Resultados" route="/resultados" />
|
|
86
|
+ <Item icon={<FingerprintIcon/>} selected={selectedIndex} change={handleListItemClick} index={5} title="Pruebas" route="/pruebas" />
|
|
87
|
+ <Item icon={<MiscellaneousServicesIcon/>} selected={selectedIndex} change={handleListItemClick} index={6} title="Configuraciones" route="/configuraciones" />
|
|
88
|
+ <Item icon={<HistoryIcon/>} selected={selectedIndex} change={handleListItemClick} index={7} title="Historial" route="/historial" />
|
|
89
|
+ </List>
|
|
90
|
+ )
|
|
91
|
+};
|
54
|
92
|
|
55
|
93
|
export const secondaryListItems = (
|
56
|
94
|
<Nav>
|
57
|
95
|
<ListSubheader inset>EXTRAS</ListSubheader>
|
58
|
|
- <Item icon={<StarIcon/>} title="Elementos" route="/work" />
|
59
|
|
- <Item icon={<OndemandVideoIcon/>} title="Tutoriales" route="/work" />
|
60
|
|
- <Item icon={<SupportAgentIcon/>} title="Asistencia Técnica" route="/work" />
|
|
96
|
+ <Item selected={false} icon={<StarIcon/>} title="Elementos" route="/work" />
|
|
97
|
+ <Item selected={false} icon={<OndemandVideoIcon/>} title="Tutoriales" route="/work" />
|
|
98
|
+ <Item selected={false} icon={<SupportAgentIcon/>} title="Asistencia Técnica" route="/work" />
|
61
|
99
|
</Nav>
|
62
|
100
|
);
|