mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Converted user and website settings.
This commit is contained in:
parent
4c24e54fdd
commit
b5c6194f36
59 changed files with 363 additions and 554 deletions
29
src/components/layout/MenuNav.tsx
Normal file
29
src/components/layout/MenuNav.tsx
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { List, ListItem, Text } from '@umami/react-zen';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import Link from 'next/link';
|
||||
|
||||
export interface SideNavProps {
|
||||
items: any[];
|
||||
shallow?: boolean;
|
||||
scroll?: boolean;
|
||||
}
|
||||
|
||||
export function MenuNav({ items, shallow = true, scroll = false }: SideNavProps) {
|
||||
const pathname = usePathname();
|
||||
|
||||
return (
|
||||
<List>
|
||||
{items.map(({ key, label, url }) => {
|
||||
const isSelected = pathname.startsWith(url);
|
||||
|
||||
return (
|
||||
<ListItem key={key}>
|
||||
<Link href={url} shallow={shallow} scroll={scroll}>
|
||||
<Text weight={isSelected ? 'bold' : 'regular'}>{label}</Text>
|
||||
</Link>
|
||||
</ListItem>
|
||||
);
|
||||
})}
|
||||
</List>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue