|
|
@@ -1,11 +1,13 @@
|
|
|
import * as React from 'react';
|
|
|
+import ListItemButton from '@mui/material/ListItemButton';
|
|
|
import ListItem from '@mui/material/ListItem';
|
|
|
+import List from '@mui/material/List';
|
|
|
+
|
|
|
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
|
import ListItemText from '@mui/material/ListItemText';
|
|
|
import ListSubheader from '@mui/material/ListSubheader';
|
|
|
|
|
|
import { Nav } from 'react-bootstrap';
|
|
|
-import { NavLink } from 'react-router-dom'
|
|
|
|
|
|
import HomeIcon from '@mui/icons-material/Home'
|
|
|
import WorkIcon from '@mui/icons-material/Work';
|
|
|
@@ -21,42 +23,78 @@ import OndemandVideoIcon from '@mui/icons-material/OndemandVideo';
|
|
|
import StarIcon from '@mui/icons-material/Star';
|
|
|
import SupportAgentIcon from '@mui/icons-material/SupportAgent';
|
|
|
|
|
|
+import NavStyle from './NavStyle'
|
|
|
+
|
|
|
+
|
|
|
function Item (props) {
|
|
|
+
|
|
|
+
|
|
|
+ function change (event){
|
|
|
+ props.change(event, props.index)
|
|
|
+ }
|
|
|
+ let isOn = props.selected === props.index
|
|
|
+
|
|
|
+ //.css-10oikv1-MuiButtonBase-root-MuiListItem-root.Mui-selected
|
|
|
return(
|
|
|
- <ListItem button>
|
|
|
+ <ListItem
|
|
|
+ sx={{
|
|
|
+ color : '#25344f',
|
|
|
+ '& .MuiButtonBase-selected' :{
|
|
|
+ color : '#121212',
|
|
|
+ backgroundColor : '#101010'
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ selected={isOn}
|
|
|
+ onClick={change}
|
|
|
+ button
|
|
|
+ >
|
|
|
<ListItemIcon>
|
|
|
{props.icon}
|
|
|
</ListItemIcon>
|
|
|
- <Nav.Item>
|
|
|
- <NavLink to={props.route}>
|
|
|
- <ListItemText primary={props.title} />
|
|
|
- </NavLink>
|
|
|
- </Nav.Item>
|
|
|
+ <ListItemText
|
|
|
+ sx={{
|
|
|
+ fontSize: 12,
|
|
|
+ ' .css-10hburv-MuiTypography-root' : {
|
|
|
+ fontSize : '.875rem'
|
|
|
+ },
|
|
|
+ }}
|
|
|
+ primary={props.title}
|
|
|
+ />
|
|
|
</ListItem>
|
|
|
)
|
|
|
}
|
|
|
|
|
|
|
|
|
-export const mainListItems = (
|
|
|
- <Nav>
|
|
|
- <ListSubheader inset>MENÚ</ListSubheader>
|
|
|
- <Item icon={<HomeIcon/>} title="Inicio" route="/home" />
|
|
|
- <Item icon={<WorkIcon/>} title="Puestos" route="/work" />
|
|
|
- <Item icon={<VisibilityOffIcon/>} title="Contraseñas" route="/work" />
|
|
|
- <Item icon={<PeopleAltIcon/>} title="Expedientes" route="/work" />
|
|
|
- <Item icon={<EqualizerIcon/>} title="Resultados" route="/work" />
|
|
|
- <Item icon={<FingerprintIcon/>} title="Pruebas" route="/work" />
|
|
|
- <Item icon={<MiscellaneousServicesIcon/>} title="Configuraciones" route="/work" />
|
|
|
- <Item icon={<HistoryIcon/>} title="Historial" route="/work" />
|
|
|
+export const MainListItems = () => {
|
|
|
+
|
|
|
+ const [selectedIndex, setSelectedIndex] = React.useState(1);
|
|
|
|
|
|
- </Nav>
|
|
|
-);
|
|
|
+
|
|
|
+ const handleListItemClick = (event, index) => {
|
|
|
+ setSelectedIndex(index);
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ return(
|
|
|
+ <List>
|
|
|
+ <ListSubheader inset>MENÚ</ListSubheader>
|
|
|
+ <Item icon={<HomeIcon/>} index={0} selected={selectedIndex} change={handleListItemClick} title="Inicio" route="/dashboard" />
|
|
|
+ <Item icon={<WorkIcon/>} index={1} selected={selectedIndex} change={handleListItemClick} title="Puestos" route="/puestos" />
|
|
|
+ <Item icon={<VisibilityOffIcon/>} selected={selectedIndex} change={handleListItemClick} index={2} title="Contraseñas" route="/contrasenas" />
|
|
|
+ <Item icon={<PeopleAltIcon/>} selected={selectedIndex} change={handleListItemClick} index={3} title="Expedientes" route="/expedientes" />
|
|
|
+ <Item icon={<EqualizerIcon/>} selected={selectedIndex} change={handleListItemClick} index={4} title="Resultados" route="/resultados" />
|
|
|
+ <Item icon={<FingerprintIcon/>} selected={selectedIndex} change={handleListItemClick} index={5} title="Pruebas" route="/pruebas" />
|
|
|
+ <Item icon={<MiscellaneousServicesIcon/>} selected={selectedIndex} change={handleListItemClick} index={6} title="Configuraciones" route="/configuraciones" />
|
|
|
+ <Item icon={<HistoryIcon/>} selected={selectedIndex} change={handleListItemClick} index={7} title="Historial" route="/historial" />
|
|
|
+ </List>
|
|
|
+ )
|
|
|
+};
|
|
|
|
|
|
export const secondaryListItems = (
|
|
|
<Nav>
|
|
|
<ListSubheader inset>EXTRAS</ListSubheader>
|
|
|
- <Item icon={<StarIcon/>} title="Elementos" route="/work" />
|
|
|
- <Item icon={<OndemandVideoIcon/>} title="Tutoriales" route="/work" />
|
|
|
- <Item icon={<SupportAgentIcon/>} title="Asistencia Técnica" route="/work" />
|
|
|
+ <Item selected={false} icon={<StarIcon/>} title="Elementos" route="/work" />
|
|
|
+ <Item selected={false} icon={<OndemandVideoIcon/>} title="Tutoriales" route="/work" />
|
|
|
+ <Item selected={false} icon={<SupportAgentIcon/>} title="Asistencia Técnica" route="/work" />
|
|
|
</Nav>
|
|
|
);
|