Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3252 Rev 3270
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
2
import { NavLink as Link } from 'react-router-dom'
2
import { NavLink as Link, useMatch } from 'react-router-dom'
3
import {
3
import {
4
  List,
4
  List,
5
  ListItem,
5
  ListItem,
6
  ListItemButton,
6
  ListItemButton,
7
  ListItemIcon,
7
  ListItemIcon,
Línea 32... Línea 32...
32
    </Widget>
32
    </Widget>
33
  )
33
  )
34
}
34
}
Línea 35... Línea 35...
35
 
35
 
-
 
36
function MenuItem({ to, icon, label, onClick }) {
-
 
37
  const match = useMatch(to)
36
function MenuItem({ to, icon, label, onClick }) {
38
 
37
  return (
39
  return (
38
    <ListItem>
40
    <ListItem sx={{ display: match ? 'none' : 'flex' }}>
39
      <ListItemButton LinkComponent={Link} to={to} onClick={onClick}>
41
      <ListItemButton LinkComponent={Link} to={to} onClick={onClick}>
40
        {icon && <ListItemIcon>{icon}</ListItemIcon>}
42
        {icon && <ListItemIcon>{icon}</ListItemIcon>}
41
        <ListItemText
43
        <ListItemText
42
          primary={label}
44
          primary={label}