Skip to content

Commit

Permalink
docs link on sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfcosta committed Jan 9, 2025
1 parent 09e127f commit 3e74fba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/web/src/components/ConfigurationsMenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type BaseConfigurationsMenuProps = {
icon: React.ElementType
text: string
blink?: boolean
openInNewTab?: boolean
}

type ConfigurationsMenuLinkProps = BaseConfigurationsMenuProps & {
Expand All @@ -21,6 +22,7 @@ const ConfigurationsMenuLink = (props: ConfigurationsMenuLinkProps) => {
return (
<Link
href={props.href}
target={props.openInNewTab ? '_blank' : undefined}
className={clsx(
router.pathname.startsWith(props.href)
? 'text-gray-800 bg-ceramic-100/50'
Expand Down
11 changes: 11 additions & 0 deletions apps/web/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
PuzzlePieceIcon,
MagnifyingGlassIcon,
RocketLaunchIcon,
AcademicCapIcon,
} from '@heroicons/react/24/outline'
import clsx from 'clsx'
import Link from 'next/link'
Expand Down Expand Up @@ -60,6 +61,7 @@ type ConfigItem = {
icon: React.ComponentType<React.ComponentProps<any>>
hidden?: boolean
allowedRoles: Set<UserWorkspaceRole>
openInNewTab?: boolean
}

const configs = (workspaceId: string): ConfigItem[] => [
Expand Down Expand Up @@ -92,6 +94,14 @@ const configs = (workspaceId: string): ConfigItem[] => [
icon: PuzzlePieceIcon,
allowedRoles: new Set<UserWorkspaceRole>(['admin', 'editor']),
},
{
id: 'docs-sidebar-item',
name: 'Documentation',
href: `https://docs.briefer.cloud`,
icon: AcademicCapIcon,
allowedRoles: new Set<UserWorkspaceRole>(['admin', 'editor', 'viewer']),
openInNewTab: true,
},
{
id: 'settings-sidebar-item',
name: 'Settings',
Expand Down Expand Up @@ -436,6 +446,7 @@ export default function Layout({
href={item.href}
text={item.name}
icon={item.icon}
openInNewTab={item.openInNewTab ?? false}
blink={
item.id === 'data-sources-sidebar-item' &&
!hasUserDataSource
Expand Down

0 comments on commit 3e74fba

Please sign in to comment.