Fix admin nav issues
This commit is contained in:
1 parent
b823a6ca3e
commit
28f738717d
4 files changed
+8
-24
No files matched your search
@@ -10,6 +10,7 @@ import {
|
||||
TooltipTrigger,
|
||||
} from '@umami/react-zen';
|
||||
import Link from 'next/link';
|
||||
import { AdminNav } from '@/app/(main)/admin/AdminNav';
|
||||
import { SettingsNav } from '@/app/(main)/settings/SettingsNav';
|
||||
import { WebsiteNav } from '@/app/(main)/websites/[websiteId]/WebsiteNav';
|
||||
import { IconLabel } from '@/components/common/IconLabel';
|
||||
@@ -103,6 +104,8 @@ export function SideNav(props: any) {
|
||||
<WebsiteNav websiteId={websiteId} isCollapsed={isCollapsed} />
|
||||
) : pathname.includes('/settings') ? (
|
||||
<SettingsNav isCollapsed={isCollapsed} />
|
||||
) : pathname.includes('/admin') ? (
|
||||
<AdminNav />
|
||||
) : (
|
||||
<Column gap="2">
|
||||
{links.map(({ id, path, label, icon }) => {
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
'use client';
|
||||
import { Column, Grid } from '@umami/react-zen';
|
||||
import type { ReactNode } from 'react';
|
||||
import { PageBody } from '@/components/common/PageBody';
|
||||
import { useLoginQuery } from '@/components/hooks';
|
||||
import { AdminNav } from './AdminNav';
|
||||
|
||||
export function AdminLayout({ children }: { children: ReactNode }) {
|
||||
const { user } = useLoginQuery();
|
||||
@@ -12,21 +10,5 @@ export function AdminLayout({ children }: { children: ReactNode }) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Grid columns={{ base: '1fr', lg: 'auto 1fr' }} width="100%" height="100%">
|
||||
<Column
|
||||
display={{ base: 'none', lg: 'flex' }}
|
||||
width="240px"
|
||||
height="100%"
|
||||
border="right"
|
||||
marginRight="2"
|
||||
padding="3"
|
||||
>
|
||||
<AdminNav />
|
||||
</Column>
|
||||
<Column gap="6" margin="2">
|
||||
<PageBody>{children}</PageBody>
|
||||
</Column>
|
||||
</Grid>
|
||||
);
|
||||
return <PageBody>{children}</PageBody>;
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Column, Focusable, Row, Tooltip, TooltipTrigger } from '@umami/react-zen';
|
||||
import Link from 'next/link';
|
||||
import { IconLabel } from '@/components/common/IconLabel';
|
||||
import { NavMenu } from '@/components/common/NavMenu';
|
||||
import { useMessages, useNavigation } from '@/components/hooks';
|
||||
import { ArrowLeft, Globe, User, Users } from '@/components/icons';
|
||||
import { Column, Focusable, Row, Tooltip, TooltipTrigger } from '@umami/react-zen';
|
||||
import Link from 'next/link';
|
||||
|
||||
export function AdminNav({ onItemClick }: { onItemClick?: () => void }) {
|
||||
const { t, labels } = useMessages();
|
||||
@@ -41,7 +41,7 @@ export function AdminNav({ onItemClick }: { onItemClick?: () => void }) {
|
||||
|
||||
return (
|
||||
<Column gap="2">
|
||||
<Link href={renderUrl('/boards', false)} role="button" onClick={onItemClick}>
|
||||
<Link href={renderUrl('/websites', false)} role="button" onClick={onItemClick}>
|
||||
<TooltipTrigger delay={0}>
|
||||
<Focusable>
|
||||
<Row
|
||||
@@ -58,7 +58,6 @@ export function AdminNav({ onItemClick }: { onItemClick?: () => void }) {
|
||||
</Link>
|
||||
<NavMenu
|
||||
items={items}
|
||||
title={t(labels.admin)}
|
||||
selectedKey={selectedKey}
|
||||
allowMinimize={false}
|
||||
onItemClick={onItemClick}
|
||||
|
||||
@@ -51,7 +51,7 @@ export function SettingsNav({
|
||||
|
||||
return (
|
||||
<Column gap="2">
|
||||
<Link href={renderUrl('/boards', false)} role="button" onClick={onItemClick}>
|
||||
<Link href={renderUrl('/websites', false)} role="button" onClick={onItemClick}>
|
||||
<TooltipTrigger isDisabled={!isCollapsed} delay={0}>
|
||||
<Focusable>
|
||||
<Row
|
||||
|
||||
Reference in new issue
Block a user