Update ODLUX
[ccsdk/features.git] / sdnr / wt / odlux / framework / src / components / material-ui / listItemLink.tsx
index 8828ac3..49e7be5 100644 (file)
@@ -23,6 +23,7 @@ import ListItemIcon from '@material-ui/core/ListItemIcon';
 import ListItemText from '@material-ui/core/ListItemText';\r
 \r
 import { withStyles, WithStyles, createStyles, Theme } from '@material-ui/core/styles';\r
+import { toAriaLabel } from '../../utilities/yangHelper';\r
 \r
 const styles = (theme: Theme) => createStyles({\r
   active: {\r
@@ -45,7 +46,7 @@ export const ListItemLink = withStyles(styles)((props: IListItemLinkProps) => {
     props.external ? <a target="_blank" href={to} { ...itemProps }></a> :\r
   <NavLink exact={ exact } to={ to } activeClassName={ classes.active } { ...itemProps } />);\r
 \r
-  const ariaLabel = typeof Primary === 'string' ? "link-to-"+Primary.toLowerCase().replace(/\s/g, "-") : "link-to-"+Primary.displayName?.toLowerCase();\r
+  const ariaLabel = typeof Primary === 'string' ? toAriaLabel("link-to-"+Primary) : toAriaLabel("link-to-"+Primary.displayName);\r
   return (\r
        <>\r
         <ListItem button component={ renderLink } aria-label={ariaLabel}>\r