diff --git a/src/app/(main)/MobileNav.tsx b/src/app/(main)/MobileNav.tsx
index a19449606..d3ff51ddc 100644
--- a/src/app/(main)/MobileNav.tsx
+++ b/src/app/(main)/MobileNav.tsx
@@ -1,19 +1,15 @@
-import { WebsiteNav } from '@/app/(main)/websites/[websiteId]/WebsiteNav';
-import { useMessages, useNavigation } from '@/components/hooks';
+import { Row, NavMenu, NavMenuItem, IconLabel, Text, Grid } from '@umami/react-zen';
import { Globe, Grid2x2, LinkIcon } from '@/components/icons';
-import { MobileMenuButton } from '@/components/input/MobileMenuButton';
-import { NavButton } from '@/components/input/NavButton';
-import { Logo } from '@/components/svg';
-import { Grid, IconLabel, NavMenu, NavMenuItem, Row, Text } from '@umami/react-zen';
+import { useMessages, useNavigation } from '@/components/hooks';
import Link from 'next/link';
-import { AdminNav } from './admin/AdminNav';
-import { SettingsNav } from './settings/SettingsNav';
+import { WebsiteNav } from '@/app/(main)/websites/[websiteId]/WebsiteNav';
+import { Logo } from '@/components/svg';
+import { NavButton } from '@/components/input/NavButton';
+import { MobileMenuButton } from '@/components/input/MobileMenuButton';
export function MobileNav() {
const { formatMessage, labels } = useMessages();
- const { pathname, websiteId, renderUrl } = useNavigation();
- const isAdmin = pathname.includes('/admin');
- const isSettings = pathname.includes('/settings');
+ const { websiteId, renderUrl } = useNavigation();
const links = [
{
@@ -55,8 +51,6 @@ export function MobileNav() {
})}
{websiteId && }
- {isAdmin && }
- {isSettings && }
>
);
}}
diff --git a/src/app/(main)/admin/AdminLayout.tsx b/src/app/(main)/admin/AdminLayout.tsx
index 3cc5aed39..8b1387854 100644
--- a/src/app/(main)/admin/AdminLayout.tsx
+++ b/src/app/(main)/admin/AdminLayout.tsx
@@ -1,32 +1,61 @@
'use client';
-import { PageBody } from '@/components/common/PageBody';
-import { useLoginQuery } from '@/components/hooks';
-import { Column, Grid } from '@umami/react-zen';
import { ReactNode } from 'react';
-import { AdminNav } from './AdminNav';
+import { Grid, Column } from '@umami/react-zen';
+import { useLoginQuery, useMessages, useNavigation } from '@/components/hooks';
+import { User, Users, Globe } from '@/components/icons';
+import { SideMenu } from '@/components/common/SideMenu';
+import { PageBody } from '@/components/common/PageBody';
export function AdminLayout({ children }: { children: ReactNode }) {
const { user } = useLoginQuery();
+ const { formatMessage, labels } = useMessages();
+ const { pathname } = useNavigation();
if (!user.isAdmin || process.env.cloudMode) {
return null;
}
+ const items = [
+ {
+ label: formatMessage(labels.manage),
+ items: [
+ {
+ id: 'users',
+ label: formatMessage(labels.users),
+ path: '/admin/users',
+ icon: ,
+ },
+ {
+ id: 'websites',
+ label: formatMessage(labels.websites),
+ path: '/admin/websites',
+ icon: ,
+ },
+ {
+ id: 'teams',
+ label: formatMessage(labels.teams),
+ path: '/admin/teams',
+ icon: ,
+ },
+ ],
+ },
+ ];
+
+ const selectedKey = items
+ .flatMap(e => e.items)
+ ?.find(({ path }) => path && pathname.startsWith(path))?.id;
+
return (
-
-
-
-
-
- {children}
+
+
+
+ {children}
);
}
diff --git a/src/app/(main)/admin/AdminNav.tsx b/src/app/(main)/admin/AdminNav.tsx
deleted file mode 100644
index 20c011554..000000000
--- a/src/app/(main)/admin/AdminNav.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { SideMenu } from '@/components/common/SideMenu';
-import { useMessages, useNavigation } from '@/components/hooks';
-import { Globe, User, Users } from '@/components/icons';
-
-export function AdminNav({ onItemClick }: { onItemClick?: () => void }) {
- const { formatMessage, labels } = useMessages();
- const { pathname } = useNavigation();
-
- const items = [
- {
- label: formatMessage(labels.manage),
- items: [
- {
- id: 'users',
- label: formatMessage(labels.users),
- path: '/admin/users',
- icon: ,
- },
- {
- id: 'websites',
- label: formatMessage(labels.websites),
- path: '/admin/websites',
- icon: ,
- },
- {
- id: 'teams',
- label: formatMessage(labels.teams),
- path: '/admin/teams',
- icon: ,
- },
- ],
- },
- ];
-
- const selectedKey = items
- .flatMap(e => e.items)
- ?.find(({ path }) => path && pathname.startsWith(path))?.id;
-
- return (
-
- );
-}
diff --git a/src/app/(main)/admin/teams/AdminTeamsTable.tsx b/src/app/(main)/admin/teams/AdminTeamsTable.tsx
index e54532583..d7c99a267 100644
--- a/src/app/(main)/admin/teams/AdminTeamsTable.tsx
+++ b/src/app/(main)/admin/teams/AdminTeamsTable.tsx
@@ -1,11 +1,11 @@
-import { DateDistance } from '@/components/common/DateDistance';
-import { useMessages } from '@/components/hooks';
-import { Edit, Trash } from '@/components/icons';
-import { MenuButton } from '@/components/input/MenuButton';
-import { DataColumn, DataTable, Dialog, Icon, MenuItem, Modal, Row, Text } from '@umami/react-zen';
-import { TeamDeleteForm } from '../../teams/[teamId]/TeamDeleteForm';
-import Link from 'next/link';
import { useState } from 'react';
+import { Row, Text, Icon, DataTable, DataColumn, MenuItem, Modal } from '@umami/react-zen';
+import Link from 'next/link';
+import { Trash } from '@/components/icons';
+import { useMessages } from '@/components/hooks';
+import { Edit } from '@/components/icons';
+import { MenuButton } from '@/components/input/MenuButton';
+import { DateDistance } from '@/components/common/DateDistance';
export function AdminTeamsTable({
data = [],
@@ -15,7 +15,7 @@ export function AdminTeamsTable({
showActions?: boolean;
}) {
const { formatMessage, labels } = useMessages();
- const [deleteTeam, setDeleteTeam] = useState(null);
+ const [deleteUser, setDeleteUser] = useState(null);
return (
<>
@@ -60,7 +60,7 @@ export function AdminTeamsTable({