From a16663d08df277b5aa68ccf3afe7e11722bcb558 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sun, 4 Jul 2021 03:40:28 +0300 Subject: [PATCH] SidebarLink update --- .../components/SidebarLink/SidebarLink.js | 71 +++++++++---------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/src/components/Sidebar/components/SidebarLink/SidebarLink.js b/src/components/Sidebar/components/SidebarLink/SidebarLink.js index 0ffd3a8..802ad00 100644 --- a/src/components/Sidebar/components/SidebarLink/SidebarLink.js +++ b/src/components/Sidebar/components/SidebarLink/SidebarLink.js @@ -6,7 +6,7 @@ import { ListItem, ListItemIcon, ListItemText, - Typography, + Typography } from "@material-ui/core"; import { Inbox as InboxIcon } from "@material-ui/icons"; import { Link } from "react-router-dom"; @@ -26,7 +26,7 @@ export default function SidebarLink({ location, isSidebarOpened, nested, - type, + type }) { var classes = useStyles(); @@ -36,19 +36,19 @@ export default function SidebarLink({ link && (location.pathname === link || location.pathname.indexOf(link) !== -1); + if (type === "divider") return ; if (type === "title") return ( {label} ); - if (type === "divider") return ; - if (link && link.includes('http')) { + if (link && link.includes("http")) { return ( - - {nested ? : icon} - - + + {nested ? : icon} + + - ) + ); } + if (!children) return ( - {nested ? : icon} + {nested ? icon || : icon} @@ -128,7 +129,7 @@ export default function SidebarLink({ > {icon ? icon : } @@ -137,8 +138,8 @@ export default function SidebarLink({ classes={{ primary: classnames(classes.linkText, { [classes.linkTextActive]: isLinkActive, - [classes.linkTextHidden]: !isSidebarOpened, - }), + [classes.linkTextHidden]: !isSidebarOpened + }) }} primary={label} /> @@ -151,7 +152,7 @@ export default function SidebarLink({ className={classes.nestedList} > - {children.map(childrenLink => ( + {children.map((childrenLink) => ( ); - // ########################################################### - function toggleCollapse(e) { if (isSidebarOpened) { e.preventDefault();