mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
fixed navigationItems props warning
This commit is contained in:
parent
d0b2c8fd1c
commit
bdf49690a1
@ -92,15 +92,15 @@ export function Header(props: SheetProps & {
|
||||
navigationItems: { name: string, href: string, icon: React.ReactNode }[],
|
||||
}) {
|
||||
const stackAdminApp = useAdminApp();
|
||||
const { isCompactMediaQuery, onShowSidebar, ...sheetProps } = props;
|
||||
const { isCompactMediaQuery, onShowSidebar, navigationItems, ...sheetProps } = props;
|
||||
const basePath = `/projects/${stackAdminApp.projectId}`;
|
||||
const pathname = usePathname();
|
||||
|
||||
const selectedItem = React.useMemo(() => {
|
||||
return props.navigationItems.find((item) => {
|
||||
return navigationItems.find((item) => {
|
||||
return new URL(basePath + item.href, "https://example.com").pathname === pathname;
|
||||
});
|
||||
}, [pathname, basePath, props.navigationItems]);
|
||||
}, [pathname, basePath, navigationItems]);
|
||||
|
||||
return (
|
||||
<Sheet
|
||||
|
||||
Loading…
Reference in New Issue
Block a user