removed some build warnings
This commit was merged in pull request #5.
This commit is contained in:
@@ -10,7 +10,7 @@ export default function AsideLink({name, to, icon}) {
|
||||
|
||||
return (
|
||||
<Link
|
||||
className={`w-full flex items-center gap-2 px-4 py-2 my-1 text-[13px] sm:text-sm font-semibold rounded-md hover:bg-white dark:hover:bg-black-box text-slate-500 dark:text-white-body/80 ${pathname == to ? 'bg-white-body dark:bg-black-box' : ''}`}
|
||||
className={`w-full flex items-center gap-2 px-4 py-2 my-1 text-[13px] sm:text-sm font-semibold rounded-md hover:bg-white dark:hover:bg-black-box text-slate-500 dark:text-white-body/80 ${pathname === to ? 'bg-white-body dark:bg-black-box' : ''}`}
|
||||
to={to}
|
||||
onClick={()=>setShowAsideDrawer(false)}
|
||||
>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState } from "react";
|
||||
import { useLocation } from "react-router-dom"
|
||||
// import { useLocation } from "react-router-dom"
|
||||
import { FaCaretDown } from "react-icons/fa";
|
||||
import Icons from "../../Icons";
|
||||
import { GeneralLayoutContext } from "../../../context/GeneralLayoutContext";
|
||||
@@ -9,9 +9,9 @@ export default function AsideLinkWithSubLinks({name, icon, to, children, isOpen}
|
||||
|
||||
const {shrinkAside} = GeneralLayoutContext()
|
||||
|
||||
const {pathname} = useLocation()
|
||||
// const {pathname} = useLocation()
|
||||
|
||||
const isMatchedPath = pathname.split('/').includes('')
|
||||
// const isMatchedPath = pathname.split('/').includes('')
|
||||
// isMatchedPath.splice(0,1)
|
||||
|
||||
const [hideSubMenu, setHideSubMenu] = useState(isOpen)
|
||||
|
||||
@@ -4,7 +4,7 @@ import DummyLogo from "../../DummyLogo";
|
||||
import MainBtn from "../../MainBtn";
|
||||
import AsideLink from "./AsideLink";
|
||||
import AsideLinkWithSubLinks from "./AsideLinkWithSubLinks";
|
||||
import { useSelector } from "react-redux";
|
||||
// import { useSelector } from "react-redux";
|
||||
import { GeneralLayoutContext } from "../../../context/GeneralLayoutContext";
|
||||
import { TbLogout2 } from "react-icons/tb";
|
||||
import UserAvatar from '../../../assets/user_avatar.jpg'
|
||||
@@ -14,10 +14,10 @@ export default function DashboardAside() {
|
||||
|
||||
const {pathname} = useLocation()
|
||||
|
||||
const {setLogoutModal, activeMenu, handleActiveMenu} = GeneralLayoutContext()
|
||||
const {setLogoutModal, handleActiveMenu} = GeneralLayoutContext()
|
||||
|
||||
const {userDetails} = useSelector((state) => state.userDetails) // GETS LOGGED IN USER ROLE DETAILS
|
||||
const {role}= userDetails
|
||||
// const {userDetails} = useSelector((state) => state.userDetails) // GETS LOGGED IN USER ROLE DETAILS
|
||||
// const {role}= userDetails
|
||||
|
||||
return (
|
||||
<div className='w-full h-full flex flex-col'>
|
||||
@@ -28,7 +28,7 @@ export default function DashboardAside() {
|
||||
|
||||
<div className="aside-scroll-design w-full flex flex-col gap-2 h-full overflow-y-auto">
|
||||
{asideNavLinks.map((link, index) => {
|
||||
let active = link.status == 1 ? true : false
|
||||
let active = link.status === 1 ? true : false
|
||||
let hasSubLinks = (link.subLinks && link.subLinks.length > 0) ? true : false
|
||||
if(active && !hasSubLinks){
|
||||
return (
|
||||
@@ -53,10 +53,10 @@ export default function DashboardAside() {
|
||||
{link.title &&
|
||||
<h1 className="px-4 py-2 text-sm sm:text-sm text-slate-500 dark:text-white font-semibold uppercase mt-3 mb-1 border-b border-slate-500 dark:border-white">{link.title}</h1>
|
||||
}
|
||||
<AsideLinkWithSubLinks name={link.name} icon={link.icon} isOpen={subLinkList.includes(pathname) || index==1} >
|
||||
<AsideLinkWithSubLinks name={link.name} icon={link.icon} isOpen={subLinkList.includes(pathname) || index===1} >
|
||||
<>
|
||||
{link.subLinks.map((subItem, index)=>{
|
||||
let active = subItem.status == 1 ? true : false
|
||||
let active = subItem.status === 1 ? true : false
|
||||
let hasSubLinks = (subItem.subLinks && subItem.subLinks.length > 0) ? true : false
|
||||
if(active && !hasSubLinks){
|
||||
return (
|
||||
@@ -74,13 +74,15 @@ export default function DashboardAside() {
|
||||
<AsideLinkWithSubLinks key={subItem.name} name={subItem.name} icon={subItem.icon} isOpen={subLinkList.includes(pathname)}>
|
||||
<>
|
||||
{subItem.subLinks.map((item, index)=>{
|
||||
let active = item.status == 1 ? true : false
|
||||
let active = item.status === 1 ? true : false
|
||||
if(active){
|
||||
return (
|
||||
<div key={index}>
|
||||
<AsideLink key={index} to={item.to} name={item.name} icon={item.icon} />
|
||||
</div>
|
||||
)
|
||||
}else{
|
||||
return null
|
||||
}
|
||||
})}
|
||||
</>
|
||||
@@ -94,6 +96,8 @@ export default function DashboardAside() {
|
||||
</AsideLinkWithSubLinks>
|
||||
</div>
|
||||
)
|
||||
}else{
|
||||
return null
|
||||
}
|
||||
})}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user