Skip to content

Commit d0631d7

Browse files
committed
Revert: Team Settings Tabbar layout and improve Sidebar NavItems (#177)
<!-- CURSOR_SUMMARY --> > [!NOTE] > Replaces the tabbed `/settings` route with standalone `/general` and `/keys` pages and updates redirects, URLs, layout config, and sidebar structure. > > - **Routing & URLs**: > - Remove `settings` parallel routes; add dedicated `pages` at `.../[teamIdOrSlug]/general/page.tsx` and `.../[teamIdOrSlug]/keys/page.tsx`. > - Update `PROTECTED_URLS` to include `GENERAL` and `KEYS` (remove `SETTINGS`). > - Adjust `TAB_URL_MAP` in `src/app/dashboard/route.ts` to point `settings/team` to `GENERAL` and add `keys` mapping. > - Update layout configs to add `/dashboard/*/general` and `/dashboard/*/keys` (remove `/dashboard/*/settings`). > - **Sidebar**: > - Replace `Settings` link with separate `General` and `API Keys` links; reorder `Members`; update `activeMatch` patterns. > - Allow `SidebarNavItem.icon` to accept custom function components; use `SettingsIcon` for General. > - Regroup billing links under `billing` group and adjust ordering. > - **UI Pages**: > - Implement `General` (profile, name, info cards) and `API Keys` (table and create dialog) pages within `Frame` wrappers. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit cef069b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent b58f7e7 commit d0631d7

File tree

8 files changed

+50
-85
lines changed

8 files changed

+50
-85
lines changed

src/app/dashboard/[teamIdOrSlug]/settings/layout.tsx

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/app/dashboard/[teamIdOrSlug]/settings/page.tsx

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/app/dashboard/route.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ const TAB_URL_MAP: Record<string, (teamId: string) => string> = {
1212
usage: (teamId) => PROTECTED_URLS.USAGE(teamId),
1313
billing: (teamId) => PROTECTED_URLS.BILLING(teamId),
1414
budget: (teamId) => PROTECTED_URLS.BUDGET(teamId),
15-
keys: (teamId) => PROTECTED_URLS.SETTINGS(teamId, 'keys'),
16-
settings: (teamId) => PROTECTED_URLS.SETTINGS(teamId, 'general'),
17-
team: (teamId) => PROTECTED_URLS.SETTINGS(teamId, 'general'),
15+
keys: (teamId) => PROTECTED_URLS.KEYS(teamId),
16+
settings: (teamId) => PROTECTED_URLS.GENERAL(teamId),
17+
team: (teamId) => PROTECTED_URLS.GENERAL(teamId),
1818
members: (teamId) => PROTECTED_URLS.MEMBERS(teamId),
1919
account: (_) => PROTECTED_URLS.ACCOUNT_SETTINGS,
2020
personal: (_) => PROTECTED_URLS.ACCOUNT_SETTINGS,

src/configs/layout.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@ const DASHBOARD_LAYOUT_CONFIGS: Record<string, DashboardLayoutConfig> = {
3030
title: 'Members',
3131
type: 'default',
3232
},
33-
'/dashboard/*/settings': {
34-
title: 'Settings',
35-
type: 'custom',
33+
'/dashboard/*/keys': {
34+
title: 'API Keys',
35+
type: 'default',
36+
},
37+
'/dashboard/*/general': {
38+
title: 'General',
39+
type: 'default',
3640
},
3741
'/dashboard/*/billing': {
3842
title: 'Billing',

src/configs/sidebar.ts

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { SettingsIcon } from '@/ui/primitives/icons'
12
import {
23
Activity,
34
Box,
@@ -9,7 +10,7 @@ import {
910
UserRoundCog,
1011
Users,
1112
} from 'lucide-react'
12-
import { ForwardRefExoticComponent, RefAttributes } from 'react'
13+
import { ForwardRefExoticComponent, JSX, RefAttributes } from 'react'
1314
import { INCLUDE_BILLING } from './flags'
1415
import { PROTECTED_URLS } from './urls'
1516

@@ -20,9 +21,12 @@ type SidebarNavArgs = {
2021
export type SidebarNavItem = {
2122
label: string
2223
href: (args: SidebarNavArgs) => string
23-
icon: ForwardRefExoticComponent<
24-
Omit<LucideProps, 'ref'> & RefAttributes<SVGSVGElement>
25-
>
24+
icon:
25+
| ForwardRefExoticComponent<
26+
Omit<LucideProps, 'ref'> & RefAttributes<SVGSVGElement>
27+
>
28+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
29+
| ((...args: any[]) => JSX.Element)
2630
group?: string
2731
activeMatch?: string
2832
}
@@ -40,49 +44,55 @@ export const SIDEBAR_MAIN_LINKS: SidebarNavItem[] = [
4044
icon: Container,
4145
activeMatch: `/dashboard/*/templates`,
4246
},
43-
...(INCLUDE_BILLING
44-
? [
45-
{
46-
label: 'Usage',
47-
href: (args: SidebarNavArgs) =>
48-
PROTECTED_URLS.USAGE(args.teamIdOrSlug!),
49-
icon: Activity,
50-
activeMatch: `/dashboard/*/usage/**`,
51-
},
52-
]
53-
: []),
47+
5448
{
55-
label: 'Members',
56-
href: (args) => PROTECTED_URLS.MEMBERS(args.teamIdOrSlug!),
57-
icon: Users,
49+
label: 'General',
50+
href: (args) => PROTECTED_URLS.GENERAL(args.teamIdOrSlug!),
51+
icon: SettingsIcon,
5852
group: 'team',
59-
activeMatch: `/dashboard/*/members/**`,
53+
activeMatch: `/dashboard/*/general`,
6054
},
6155
{
62-
label: 'Settings',
63-
href: (args) => PROTECTED_URLS.SETTINGS(args.teamIdOrSlug!, 'general'),
56+
label: 'API Keys',
57+
href: (args) => PROTECTED_URLS.KEYS(args.teamIdOrSlug!),
6458
icon: Key,
6559
group: 'team',
66-
activeMatch: `/dashboard/*/settings/**`,
60+
activeMatch: `/dashboard/*/keys`,
6761
},
62+
{
63+
label: 'Members',
64+
href: (args) => PROTECTED_URLS.MEMBERS(args.teamIdOrSlug!),
65+
icon: Users,
66+
group: 'team',
67+
activeMatch: `/dashboard/*/members`,
68+
},
69+
6870
...(INCLUDE_BILLING
6971
? [
7072
{
71-
label: 'Billing',
73+
label: 'Usage',
7274
href: (args: SidebarNavArgs) =>
73-
PROTECTED_URLS.BILLING(args.teamIdOrSlug!),
74-
icon: CreditCard,
75-
group: 'expenses',
76-
activeMatch: `/dashboard/*/billing/**`,
75+
PROTECTED_URLS.USAGE(args.teamIdOrSlug!),
76+
icon: Activity,
77+
group: 'billing',
78+
activeMatch: `/dashboard/*/usage/**`,
7779
},
7880
{
7981
label: 'Budget',
8082
href: (args: SidebarNavArgs) =>
8183
PROTECTED_URLS.BUDGET(args.teamIdOrSlug!),
82-
group: 'expenses',
84+
group: 'billing',
8385
icon: DollarSign,
8486
activeMatch: `/dashboard/*/budget/**`,
8587
},
88+
{
89+
label: 'Billing',
90+
href: (args: SidebarNavArgs) =>
91+
PROTECTED_URLS.BILLING(args.teamIdOrSlug!),
92+
icon: CreditCard,
93+
group: 'billing',
94+
activeMatch: `/dashboard/*/billing/**`,
95+
},
8696
]
8797
: []),
8898
]

src/configs/urls.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export const PROTECTED_URLS = {
1212
NEW_TEAM: '/dashboard/teams/new',
1313
TEAMS: '/dashboard/teams',
1414

15-
SETTINGS: (teamIdOrSlug: string, tab?: 'general' | 'keys') =>
16-
`/dashboard/${teamIdOrSlug}/settings${tab ? `?tab=${tab}` : ''}`,
15+
GENERAL: (teamIdOrSlug: string) => `/dashboard/${teamIdOrSlug}/general`,
16+
KEYS: (teamIdOrSlug: string) => `/dashboard/${teamIdOrSlug}/keys`,
1717
MEMBERS: (teamIdOrSlug: string) => `/dashboard/${teamIdOrSlug}/members`,
1818

1919
SANDBOXES: (teamIdOrSlug: string, tab?: 'list' | 'monitoring') =>

0 commit comments

Comments
 (0)