Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): add faq and groups for sources and destinations #67

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const items = [

export function FaqBanner() {
return (
<div className="flex flex-col gap-4 items-center w-full">
<div id="faq" className="flex flex-col gap-4 items-center w-full">
<Text size="2xl" weight={'medium'} align={'center'}>
<h2>Frequently asked questions</h2>
</Text>
Expand Down
107 changes: 97 additions & 10 deletions apps/engine/src/modules/app-layout/app-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

import * as React from 'react';

import { Icons, LucideIcons } from '@ds-project/components';
import {
cn,
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
Icons,
LucideIcons,
PenpotLogo,
SidebarMenuSub,
SidebarMenuSubButton,
SidebarMenuSubItem,
} from '@ds-project/components';

import {
Sidebar,
Expand Down Expand Up @@ -34,6 +45,41 @@ const navigationItems = [
},
];

const groupItems = [
{
title: 'Sources',
icon: LucideIcons.Target,
items: [
{
title: 'Figma',
url: '/app/sources',
icon: LucideIcons.Figma,
},
{
title: 'Penpot',
icon: PenpotLogo,
disabled: true,
},
],
},
{
title: 'Destinations',
icon: LucideIcons.Code2,
items: [
{
title: 'GitHub',
url: '/app/destinations',
icon: LucideIcons.Github,
},
{
title: 'GitLab',
icon: LucideIcons.Gitlab,
disabled: true,
},
],
},
];

export function AppSidebar({ email }: { email: string }) {
return (
<Sidebar collapsible="icon">
Expand All @@ -51,15 +97,48 @@ export function AppSidebar({ email }: { email: string }) {
<SidebarGroup>
<SidebarGroupLabel>Connections</SidebarGroupLabel>
<SidebarMenu>
{navigationItems.map((item) => (
<SidebarMenuItem key={item.title}>
<SidebarMenuButton tooltip={item.title} asChild>
<Link href={item.url}>
<item.icon />
<span>{item.title}</span>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
{groupItems.map((groupItem) => (
<Collapsible
key={groupItem.title}
asChild
defaultOpen={true}
className="group/collapsible"
>
<SidebarMenuItem>
<CollapsibleTrigger asChild>
<SidebarMenuButton tooltip={groupItem.title}>
<groupItem.icon />
<span>{groupItem.title}</span>
<LucideIcons.ChevronRight className="ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" />
</SidebarMenuButton>
</CollapsibleTrigger>
<CollapsibleContent>
<SidebarMenuSub>
{groupItem.items.map((subItem) => (
<SidebarMenuSubItem key={subItem.title}>
{subItem.disabled ? (
<SidebarMenuSubButton
className={cn({
['opacity-55']: subItem.disabled,
})}
>
<subItem.icon />
<span>{subItem.title}</span>
</SidebarMenuSubButton>
) : (
<SidebarMenuSubButton asChild>
<a href={subItem.url}>
<subItem.icon />
<span>{subItem.title}</span>
</a>
</SidebarMenuSubButton>
)}
</SidebarMenuSubItem>
))}
</SidebarMenuSub>
</CollapsibleContent>
</SidebarMenuItem>
</Collapsible>
))}
</SidebarMenu>
</SidebarGroup>
Expand All @@ -68,6 +147,14 @@ export function AppSidebar({ email }: { email: string }) {
<SidebarGroup>
<SidebarGroupLabel>Shortcuts</SidebarGroupLabel>
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton asChild>
<Link href="/#faq" target="_blank">
<LucideIcons.ShieldQuestion />
<span>FAQs</span>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
<SidebarMenuItem>
<SidebarMenuButton asChild>
<Link href={config.discordInviteUrl} target="_blank">
Expand Down
2 changes: 1 addition & 1 deletion apps/engine/src/modules/app-layout/breadcrumb-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function BreadcrumbNav() {
<Breadcrumb>
<BreadcrumbList>
<BreadcrumbItem className="hidden capitalize md:block">
Connections
{connectionGroup}
</BreadcrumbItem>
<BreadcrumbSeparator className="hidden md:block" />
<BreadcrumbItem>
Expand Down