mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +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
|
|
@ -1,22 +1,18 @@
|
|||
import { ReactNode } from 'react';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { SideNav } from '@/components/layout/SideNav';
|
||||
import styles from './MenuLayout.module.css';
|
||||
import { Grid, Column } from '@umami/react-zen';
|
||||
import { MenuNav } from '@/components/layout/MenuNav';
|
||||
|
||||
export function MenuLayout({ items = [], children }: { items: any[]; children: ReactNode }) {
|
||||
const pathname = usePathname();
|
||||
const cloudMode = !!process.env.cloudMode;
|
||||
|
||||
const getKey = () => items.find(({ url }) => pathname === url)?.key;
|
||||
|
||||
return (
|
||||
<div className={styles.layout}>
|
||||
<Grid columns="auto 1fr" gap="5">
|
||||
{!cloudMode && (
|
||||
<div className={styles.menu}>
|
||||
<SideNav items={items} shallow={true} selectedKey={getKey()} />
|
||||
</div>
|
||||
<Column width="240px">
|
||||
<MenuNav items={items} shallow={true} />
|
||||
</Column>
|
||||
)}
|
||||
<div className={styles.content}>{children}</div>
|
||||
</div>
|
||||
<Column>{children}</Column>
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue