Skip to content

Commit 9dff3ad

Browse files
feat(ui): add faq and groups for sources and destinations (#67)
1 parent 0908a8c commit 9dff3ad

File tree

3 files changed

+99
-12
lines changed

3 files changed

+99
-12
lines changed

apps/engine/src/components/banners/faq-banner/faq-banner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const items = [
8585

8686
export function FaqBanner() {
8787
return (
88-
<div className="flex flex-col gap-4 items-center w-full">
88+
<div id="faq" className="flex flex-col gap-4 items-center w-full">
8989
<Text size="2xl" weight={'medium'} align={'center'}>
9090
<h2>Frequently asked questions</h2>
9191
</Text>

apps/engine/src/modules/app-layout/app-sidebar.tsx

Lines changed: 97 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,18 @@
22

33
import * as React from 'react';
44

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';
617

718
import {
819
Sidebar,
@@ -34,6 +45,41 @@ const navigationItems = [
3445
},
3546
];
3647

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+
3783
export function AppSidebar({ email }: { email: string }) {
3884
return (
3985
<Sidebar collapsible="icon">
@@ -51,15 +97,48 @@ export function AppSidebar({ email }: { email: string }) {
5197
<SidebarGroup>
5298
<SidebarGroupLabel>Connections</SidebarGroupLabel>
5399
<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>
63142
))}
64143
</SidebarMenu>
65144
</SidebarGroup>
@@ -68,6 +147,14 @@ export function AppSidebar({ email }: { email: string }) {
68147
<SidebarGroup>
69148
<SidebarGroupLabel>Shortcuts</SidebarGroupLabel>
70149
<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>
71158
<SidebarMenuItem>
72159
<SidebarMenuButton asChild>
73160
<Link href={config.discordInviteUrl} target="_blank">

apps/engine/src/modules/app-layout/breadcrumb-nav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function BreadcrumbNav() {
2525
<Breadcrumb>
2626
<BreadcrumbList>
2727
<BreadcrumbItem className="hidden capitalize md:block">
28-
Connections
28+
{connectionGroup}
2929
</BreadcrumbItem>
3030
<BreadcrumbSeparator className="hidden md:block" />
3131
<BreadcrumbItem>

0 commit comments

Comments
 (0)