perf(style): codex-skills/cowa-admin-list-ui
This commit is contained in:
@@ -5,6 +5,7 @@ import { NavLink, Space } from "@mantine/core"
|
||||
import { usePathname, useRouter } from "next/navigation"
|
||||
import { useState } from "react"
|
||||
import { MenuItem } from "../common"
|
||||
import { getShellNavLinkStyles } from "../navStyles"
|
||||
import { ClientIcon } from "./ClientIcon"
|
||||
|
||||
interface LinksGroupProps {
|
||||
@@ -50,6 +51,10 @@ export function LinksGroup({
|
||||
))
|
||||
: null
|
||||
|
||||
const isActive = hasLinks
|
||||
? false
|
||||
: pathname.startsWith(`/${routerUrl}/${item.url}`)
|
||||
|
||||
return (
|
||||
<>
|
||||
<NavLink
|
||||
@@ -63,9 +68,7 @@ export function LinksGroup({
|
||||
opened={opened}
|
||||
label={item.title}
|
||||
noWrap={true}
|
||||
active={
|
||||
hasLinks ? false : pathname.startsWith(`/${routerUrl}/${item.url}`)
|
||||
}
|
||||
active={isActive}
|
||||
leftSection={
|
||||
<>
|
||||
<Space w={offset} />
|
||||
@@ -77,7 +80,8 @@ export function LinksGroup({
|
||||
)}
|
||||
</>
|
||||
}
|
||||
childrenOffset={0}>
|
||||
childrenOffset={0}
|
||||
styles={getShellNavLinkStyles(isActive)}>
|
||||
{children}
|
||||
</NavLink>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user