Skip to content

Commit 5ae48e8

Browse files
authored
refactor(nav-items) extract components array and add alphabetical sorting to nav items (#191)
1 parent 58737c6 commit 5ae48e8

File tree

1 file changed

+177
-175
lines changed

1 file changed

+177
-175
lines changed

config/nav-items.ts

Lines changed: 177 additions & 175 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,179 @@
1+
const components = [
2+
{
3+
title: "Accordion",
4+
url: "/docs/components/accordion",
5+
new: true,
6+
},
7+
{
8+
title: "Alert",
9+
url: "/docs/components/alert",
10+
},
11+
{
12+
title: "Alert Dialog",
13+
url: "/docs/components/alert-dialog",
14+
},
15+
{
16+
title: "Avatar",
17+
url: "/docs/components/avatar",
18+
},
19+
{
20+
title: "Badge",
21+
url: "/docs/components/badge",
22+
},
23+
{
24+
title: "Breadcrumb",
25+
url: "/docs/components/breadcrumb",
26+
},
27+
{
28+
title: "Button",
29+
url: "/docs/components/button",
30+
},
31+
{
32+
title: "Calendar",
33+
url: "/docs/components/calendar",
34+
},
35+
{
36+
title: "Card",
37+
url: "/docs/components/card",
38+
},
39+
{
40+
title: "Carousel",
41+
url: "/docs/components/carousel",
42+
},
43+
{
44+
title: "Chart",
45+
url: "/docs/components/chart",
46+
},
47+
{
48+
title: "Checkbox",
49+
url: "/docs/components/checkbox",
50+
},
51+
{
52+
title: "Combo Box",
53+
url: "/docs/components/combo-box",
54+
},
55+
{
56+
title: "Command",
57+
url: "/docs/components/command",
58+
},
59+
{
60+
title: "Context Menu",
61+
url: "/docs/components/context-menu",
62+
new: true,
63+
},
64+
{
65+
title: "Collapsible",
66+
url: "/docs/components/collapsible",
67+
},
68+
{
69+
title: "Date Picker",
70+
url: "/docs/components/date-picker",
71+
new: true,
72+
},
73+
{
74+
title: "Dialog",
75+
url: "/docs/components/dialog",
76+
},
77+
{
78+
title: "Dropdown Menu",
79+
url: "/docs/components/dropdown-menu",
80+
},
81+
{
82+
title: "Hover Card",
83+
url: "/docs/components/hover-card",
84+
},
85+
{
86+
title: "Input",
87+
url: "/docs/components/input",
88+
},
89+
{
90+
title: "Input OTP",
91+
url: "/docs/components/input-otp",
92+
},
93+
{
94+
title: "Scroll Area",
95+
url: "/docs/components/scroll-area",
96+
},
97+
{
98+
title: "Select",
99+
url: "/docs/components/select",
100+
},
101+
{
102+
title: "Sheet",
103+
url: "/docs/components/sheet",
104+
},
105+
{
106+
title: "Sidebar",
107+
url: "/docs/components/sidebar",
108+
new: true,
109+
},
110+
{
111+
title: "Skeleton",
112+
url: "/docs/components/skeleton",
113+
},
114+
{
115+
title: "Slider",
116+
url: "/docs/components/slider",
117+
new: true,
118+
},
119+
{
120+
title: "Label",
121+
url: "/docs/components/label",
122+
},
123+
{
124+
title: "Pagination",
125+
url: "/docs/components/pagination",
126+
},
127+
{
128+
title: "Popover",
129+
url: "/docs/components/popover",
130+
},
131+
{
132+
title: "Progress",
133+
url: "/docs/components/progress",
134+
},
135+
{
136+
title: "Separator",
137+
url: "/docs/components/separator",
138+
},
139+
{
140+
title: "Radio Group",
141+
url: "/docs/components/radio-group",
142+
},
143+
{
144+
title: "Resizable",
145+
url: "/docs/components/resizable",
146+
},
147+
{
148+
title: "Switch",
149+
url: "/docs/components/switch",
150+
},
151+
{
152+
title: "Table",
153+
url: "/docs/components/table",
154+
},
155+
{
156+
title: "Tabs",
157+
url: "/docs/components/tabs",
158+
},
159+
{
160+
title: "Textarea",
161+
url: "/docs/components/textarea",
162+
},
163+
{
164+
title: "Toggle",
165+
url: "/docs/components/toggle",
166+
},
167+
{
168+
title: "Toggle Group",
169+
url: "/docs/components/toggle-group",
170+
},
171+
{
172+
title: "Tooltip",
173+
url: "/docs/components/tooltip",
174+
},
175+
]
176+
1177
export const navItems = {
2178
header: [
3179
{
@@ -17,181 +193,7 @@ export const navItems = {
17193
{
18194
title: "Components",
19195
url: "/components/accordion",
20-
items: [
21-
{
22-
title: "Accordion",
23-
url: "/docs/components/accordion",
24-
new: true,
25-
},
26-
{
27-
title: "Alert",
28-
url: "/docs/components/alert",
29-
},
30-
{
31-
title: "Alert Dialog",
32-
url: "/docs/components/alert-dialog",
33-
},
34-
{
35-
title: "Avatar",
36-
url: "/docs/components/avatar",
37-
},
38-
{
39-
title: "Badge",
40-
url: "/docs/components/badge",
41-
},
42-
{
43-
title: "Breadcrumb",
44-
url: "/docs/components/breadcrumb",
45-
},
46-
{
47-
title: "Button",
48-
url: "/docs/components/button",
49-
},
50-
{
51-
title: "Calendar",
52-
url: "/docs/components/calendar",
53-
},
54-
{
55-
title: "Card",
56-
url: "/docs/components/card",
57-
},
58-
{
59-
title: "Carousel",
60-
url: "/docs/components/carousel",
61-
},
62-
{
63-
title: "Chart",
64-
url: "/docs/components/chart",
65-
},
66-
{
67-
title: "Checkbox",
68-
url: "/docs/components/checkbox",
69-
},
70-
{
71-
title: "Combo Box",
72-
url: "/docs/components/combo-box",
73-
},
74-
{
75-
title: "Command",
76-
url: "/docs/components/command",
77-
},
78-
{
79-
title: "Context Menu",
80-
url: "/docs/components/context-menu",
81-
new: true,
82-
},
83-
{
84-
title: "Collapsible",
85-
url: "/docs/components/collapsible",
86-
},
87-
{
88-
title: "Date Picker",
89-
url: "/docs/components/date-picker",
90-
new: true,
91-
},
92-
{
93-
title: "Dialog",
94-
url: "/docs/components/dialog",
95-
},
96-
{
97-
title: "Dropdown Menu",
98-
url: "/docs/components/dropdown-menu",
99-
},
100-
{
101-
title: "Hover Card",
102-
url: "/docs/components/hover-card",
103-
},
104-
{
105-
title: "Input",
106-
url: "/docs/components/input",
107-
},
108-
{
109-
title: "Input OTP",
110-
url: "/docs/components/input-otp",
111-
},
112-
{
113-
title: "Scroll Area",
114-
url: "/docs/components/scroll-area",
115-
},
116-
{
117-
title: "Select",
118-
url: "/docs/components/select",
119-
},
120-
{
121-
title: "Sheet",
122-
url: "/docs/components/sheet",
123-
},
124-
{
125-
title: "Sidebar",
126-
url: "/docs/components/sidebar",
127-
new: true,
128-
},
129-
{
130-
title: "Skeleton",
131-
url: "/docs/components/skeleton",
132-
},
133-
{
134-
title: "Slider",
135-
url: "/docs/components/slider",
136-
new: true,
137-
},
138-
{
139-
title: "Label",
140-
url: "/docs/components/label",
141-
},
142-
{
143-
title: "Pagination",
144-
url: "/docs/components/pagination",
145-
},
146-
{
147-
title: "Popover",
148-
url: "/docs/components/popover",
149-
},
150-
{
151-
title: "Progress",
152-
url: "/docs/components/progress",
153-
},
154-
{
155-
title: "Separator",
156-
url: "/docs/components/separator",
157-
},
158-
{
159-
title: "Radio Group",
160-
url: "/docs/components/radio-group",
161-
},
162-
{
163-
title: "Resizable",
164-
url: "/docs/components/resizable",
165-
},
166-
{
167-
title: "Switch",
168-
url: "/docs/components/switch",
169-
},
170-
{
171-
title: "Table",
172-
url: "/docs/components/table",
173-
},
174-
{
175-
title: "Tabs",
176-
url: "/docs/components/tabs",
177-
},
178-
{
179-
title: "Textarea",
180-
url: "/docs/components/textarea",
181-
},
182-
{
183-
title: "Toggle",
184-
url: "/docs/components/toggle",
185-
},
186-
{
187-
title: "Toggle Group",
188-
url: "/docs/components/toggle-group",
189-
},
190-
{
191-
title: "Tooltip",
192-
url: "/docs/components/tooltip",
193-
},
194-
],
196+
items: components.sort((a, b) => a.title.localeCompare(b.title)),
195197
},
196198
],
197199
}

0 commit comments

Comments
 (0)