Skip to content

Commit c483797

Browse files
committed
Fix some lint issues
1 parent c2392b6 commit c483797

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

resources/js/components/nav-main.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function NavMain({ lable = "Platform", items = [], openSubmenu, setOpenSu
2020
}) {
2121
const page = usePage();
2222

23-
const id = useRef<string>(useId());
23+
const id = useId();
2424

2525
const { isMobile, state, openMobile } = useSidebar();
2626

@@ -56,7 +56,7 @@ export function NavMain({ lable = "Platform", items = [], openSubmenu, setOpenSu
5656
}, [openSubmenu]);
5757

5858
const activeGroup = (navItem: NavItem) => {
59-
let foundItem = items.find((item) => {
59+
const foundItem = items.find((item) => {
6060
if (navItem.href && page.url.startsWith(resolveUrl(navItem.href))) {
6161
return item;
6262
}
@@ -77,25 +77,25 @@ export function NavMain({ lable = "Platform", items = [], openSubmenu, setOpenSu
7777
isActive={activeGroup(item)}
7878
className="cursor-pointer"
7979
tooltip={{ children: item.title }}
80-
onClick={() => handleSubmenuToggle(index, id.current)}
80+
onClick={() => handleSubmenuToggle(index, id)}
8181
>
8282
{item.icon && <item.icon />}
8383
<span>{item.title}</span>
8484
<ChevronDownIcon
85-
className={`ms-auto h-4 w-4 shrink-0 opacity-50 transition-all duration-300 ${openSubmenu?.id === id.current && openSubmenu?.index === index ? "rotate-180" : ""}`}
85+
className={`ms-auto h-4 w-4 shrink-0 opacity-50 transition-all duration-300 ${openSubmenu?.id === id && openSubmenu?.index === index ? "rotate-180" : ""}`}
8686
/>
8787
</SidebarMenuButton>
8888

8989
{(state === "expanded" || (isMobile && openMobile)) && (
9090
<div
9191
ref={(el) => {
92-
subMenuRefs.current[`${id.current}-${index}`] = el;
92+
subMenuRefs.current[`${id}-${index}`] = el;
9393
}}
9494
className="overflow-hidden transition-all duration-300"
9595
style={{
9696
height:
97-
openSubmenu?.id === id.current && openSubmenu?.index === index
98-
? `${subMenuHeight[`${id.current}-${index}`]}px`
97+
openSubmenu?.id === id && openSubmenu?.index === index
98+
? `${subMenuHeight[`${id}-${index}`]}px`
9999
: "0px",
100100
}}
101101
>

resources/js/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface NavGroup {
1818
export interface NavItem {
1919
title: string;
2020
href?: NonNullable<InertiaLinkProps['href']>;
21-
icon?: LucideIcon | any;
21+
icon?: LucideIcon | null;
2222
isActive?: boolean;
2323
subItems?: NavItem[];
2424
}

0 commit comments

Comments
 (0)