mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 08:07:12 +01:00
Fixed sidenav rendering.
This commit is contained in:
parent
8897c2508d
commit
a97445fb82
9 changed files with 95 additions and 21 deletions
|
|
@ -23,7 +23,7 @@ import { PanelButton } from '@/components/input/PanelButton';
|
|||
export function SideNav(props: SidebarProps) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { pathname, renderUrl, websiteId } = useNavigation();
|
||||
const [isCollapsed] = useGlobalState('sidenav-collapsed');
|
||||
let [isCollapsed] = useGlobalState('sidenav-collapsed');
|
||||
|
||||
const hasNav = !!(
|
||||
websiteId ||
|
||||
|
|
@ -32,19 +32,23 @@ export function SideNav(props: SidebarProps) {
|
|||
pathname.endsWith('/settings')
|
||||
);
|
||||
|
||||
if (hasNav) {
|
||||
isCollapsed = true;
|
||||
}
|
||||
|
||||
const links = [
|
||||
{
|
||||
id: 'websites',
|
||||
label: formatMessage(labels.websites),
|
||||
path: '/websites',
|
||||
icon: <Globe />,
|
||||
},
|
||||
{
|
||||
id: 'boards',
|
||||
label: formatMessage(labels.boards),
|
||||
path: '/boards',
|
||||
icon: <LayoutDashboard />,
|
||||
},
|
||||
{
|
||||
id: 'websites',
|
||||
label: formatMessage(labels.websites),
|
||||
path: '/websites',
|
||||
icon: <Globe />,
|
||||
},
|
||||
{
|
||||
id: 'links',
|
||||
label: formatMessage(labels.links),
|
||||
|
|
|
|||
24
src/app/(main)/links/LinksPage.tsx
Normal file
24
src/app/(main)/links/LinksPage.tsx
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
'use client';
|
||||
import { PageBody } from '@/components/common/PageBody';
|
||||
import { Column } from '@umami/react-zen';
|
||||
import { PageHeader } from '@/components/common/PageHeader';
|
||||
import { BoardAddButton } from '@/app/(main)/boards/BoardAddButton';
|
||||
import Link from 'next/link';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
|
||||
export function LinksPage() {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<PageBody>
|
||||
<Column>
|
||||
<PageHeader title={formatMessage(labels.links)}>
|
||||
<BoardAddButton />
|
||||
</PageHeader>
|
||||
<Link href="/teams/3a97e34a-7f9d-4de2-8754-ed81714b528d/boards/86d4095c-a2a8-4fc8-9521-103e858e2b41">
|
||||
Board 1
|
||||
</Link>
|
||||
</Column>
|
||||
</PageBody>
|
||||
);
|
||||
}
|
||||
10
src/app/(main)/links/page.tsx
Normal file
10
src/app/(main)/links/page.tsx
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { LinksPage } from './LinksPage';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export default function () {
|
||||
return <LinksPage />;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Links',
|
||||
};
|
||||
24
src/app/(main)/pixels/PixelsPage.tsx
Normal file
24
src/app/(main)/pixels/PixelsPage.tsx
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
'use client';
|
||||
import { PageBody } from '@/components/common/PageBody';
|
||||
import { Column } from '@umami/react-zen';
|
||||
import { PageHeader } from '@/components/common/PageHeader';
|
||||
import { BoardAddButton } from '@/app/(main)/boards/BoardAddButton';
|
||||
import Link from 'next/link';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
|
||||
export function PixelsPage() {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<PageBody>
|
||||
<Column>
|
||||
<PageHeader title={formatMessage(labels.pixels)}>
|
||||
<BoardAddButton />
|
||||
</PageHeader>
|
||||
<Link href="/teams/3a97e34a-7f9d-4de2-8754-ed81714b528d/boards/86d4095c-a2a8-4fc8-9521-103e858e2b41">
|
||||
Board 1
|
||||
</Link>
|
||||
</Column>
|
||||
</PageBody>
|
||||
);
|
||||
}
|
||||
10
src/app/(main)/pixels/page.tsx
Normal file
10
src/app/(main)/pixels/page.tsx
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { PixelsPage } from './PixelsPage';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export default function () {
|
||||
return <PixelsPage />;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Pixels',
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue