2
2
3
3
import * as React from 'react' ;
4
4
5
- import { Icons , LucideIcons } from '@ds-project/components' ;
5
+ import {
6
+ cn ,
7
+ Collapsible ,
8
+ CollapsibleContent ,
9
+ CollapsibleTrigger ,
10
+ Icons ,
11
+ LucideIcons ,
12
+ PenpotLogo ,
13
+ SidebarMenuSub ,
14
+ SidebarMenuSubButton ,
15
+ SidebarMenuSubItem ,
16
+ } from '@ds-project/components' ;
6
17
7
18
import {
8
19
Sidebar ,
@@ -34,6 +45,41 @@ const navigationItems = [
34
45
} ,
35
46
] ;
36
47
48
+ const groupItems = [
49
+ {
50
+ title : 'Sources' ,
51
+ icon : LucideIcons . Target ,
52
+ items : [
53
+ {
54
+ title : 'Figma' ,
55
+ url : '/app/sources' ,
56
+ icon : LucideIcons . Figma ,
57
+ } ,
58
+ {
59
+ title : 'Penpot' ,
60
+ icon : PenpotLogo ,
61
+ disabled : true ,
62
+ } ,
63
+ ] ,
64
+ } ,
65
+ {
66
+ title : 'Destinations' ,
67
+ icon : LucideIcons . Code2 ,
68
+ items : [
69
+ {
70
+ title : 'GitHub' ,
71
+ url : '/app/destinations' ,
72
+ icon : LucideIcons . Github ,
73
+ } ,
74
+ {
75
+ title : 'GitLab' ,
76
+ icon : LucideIcons . Gitlab ,
77
+ disabled : true ,
78
+ } ,
79
+ ] ,
80
+ } ,
81
+ ] ;
82
+
37
83
export function AppSidebar ( { email } : { email : string } ) {
38
84
return (
39
85
< Sidebar collapsible = "icon" >
@@ -51,15 +97,48 @@ export function AppSidebar({ email }: { email: string }) {
51
97
< SidebarGroup >
52
98
< SidebarGroupLabel > Connections</ SidebarGroupLabel >
53
99
< SidebarMenu >
54
- { navigationItems . map ( ( item ) => (
55
- < SidebarMenuItem key = { item . title } >
56
- < SidebarMenuButton tooltip = { item . title } asChild >
57
- < Link href = { item . url } >
58
- < item . icon />
59
- < span > { item . title } </ span >
60
- </ Link >
61
- </ SidebarMenuButton >
62
- </ SidebarMenuItem >
100
+ { groupItems . map ( ( groupItem ) => (
101
+ < Collapsible
102
+ key = { groupItem . title }
103
+ asChild
104
+ defaultOpen = { true }
105
+ className = "group/collapsible"
106
+ >
107
+ < SidebarMenuItem >
108
+ < CollapsibleTrigger asChild >
109
+ < SidebarMenuButton tooltip = { groupItem . title } >
110
+ < groupItem . icon />
111
+ < span > { groupItem . title } </ span >
112
+ < LucideIcons . ChevronRight className = "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" />
113
+ </ SidebarMenuButton >
114
+ </ CollapsibleTrigger >
115
+ < CollapsibleContent >
116
+ < SidebarMenuSub >
117
+ { groupItem . items . map ( ( subItem ) => (
118
+ < SidebarMenuSubItem key = { subItem . title } >
119
+ { subItem . disabled ? (
120
+ < SidebarMenuSubButton
121
+ className = { cn ( {
122
+ [ 'opacity-55' ] : subItem . disabled ,
123
+ } ) }
124
+ >
125
+ < subItem . icon />
126
+ < span > { subItem . title } </ span >
127
+ </ SidebarMenuSubButton >
128
+ ) : (
129
+ < SidebarMenuSubButton asChild >
130
+ < a href = { subItem . url } >
131
+ < subItem . icon />
132
+ < span > { subItem . title } </ span >
133
+ </ a >
134
+ </ SidebarMenuSubButton >
135
+ ) }
136
+ </ SidebarMenuSubItem >
137
+ ) ) }
138
+ </ SidebarMenuSub >
139
+ </ CollapsibleContent >
140
+ </ SidebarMenuItem >
141
+ </ Collapsible >
63
142
) ) }
64
143
</ SidebarMenu >
65
144
</ SidebarGroup >
@@ -68,6 +147,14 @@ export function AppSidebar({ email }: { email: string }) {
68
147
< SidebarGroup >
69
148
< SidebarGroupLabel > Shortcuts</ SidebarGroupLabel >
70
149
< SidebarMenu >
150
+ < SidebarMenuItem >
151
+ < SidebarMenuButton asChild >
152
+ < Link href = "/#faq" target = "_blank" >
153
+ < LucideIcons . ShieldQuestion />
154
+ < span > FAQs</ span >
155
+ </ Link >
156
+ </ SidebarMenuButton >
157
+ </ SidebarMenuItem >
71
158
< SidebarMenuItem >
72
159
< SidebarMenuButton asChild >
73
160
< Link href = { config . discordInviteUrl } target = "_blank" >
0 commit comments