Skip to content

Commit

Permalink
feat(nx-dev): add link to AI Chat beta in docs header
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Sep 20, 2023
1 parent 2ad50e9 commit b3bc436
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nx-dev/feature-ai/src/lib/feed/feed-answer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export function FeedAnswer({
<div>
<div className="text-lg flex gap-2 items-center text-slate-900 dark:text-slate-100">
Nx Assistant{' '}
<span className="rounded-md bg-red-50 dark:bg-red-900/30 px-1.5 py-0.5 text-xs font-medium text-red-600 dark:text-red-400">
alpha
<span className="rounded-md bg-yellow-50 dark:bg-yellow-900/30 px-1.5 py-0.5 text-xs font-medium text-yellow-600 dark:text-yellow-400">
beta
</span>
</div>
<p className="mt-0.5 flex items-center gap-x-1 text-sm text-slate-500">
Expand Down
20 changes: 18 additions & 2 deletions nx-dev/ui-common/src/lib/documentation-header.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { type JSX } from 'react';
import { Bars3Icon, XMarkIcon } from '@heroicons/react/24/outline';
import { AlgoliaSearch } from '@nx/nx-dev/feature-search';
import { ThemeSwitcher } from '@nx/nx-dev/ui-theme';
Expand All @@ -22,7 +23,7 @@ function Menu({ tabs }: { tabs: any[] }): JSX.Element {
)}
aria-current={tab.current ? 'page' : undefined}
>
{tab.name}
{tab.content ?? tab.name}
</Link>
))}
</nav>
Expand All @@ -42,7 +43,9 @@ export function DocumentationHeader({
const isPackages: boolean = router.asPath.startsWith('/packages');
const isPlugins: boolean = router.asPath.startsWith('/extending-nx');
const isChangelog: boolean = router.asPath.startsWith('/changelog');
const isNx: boolean = !isNxCloud && !isPackages && !isPlugins && !isChangelog;
const isAiChat: boolean = router.asPath.startsWith('/ai-chat');
const isNx: boolean =
!isNxCloud && !isPackages && !isPlugins && !isChangelog && !isAiChat;

const sections = [
{ name: 'Nx', href: '/getting-started/intro', current: isNx },
Expand All @@ -66,6 +69,19 @@ export function DocumentationHeader({
href: '/changelog',
current: isChangelog,
},
{
name: 'AI Chat',
href: '/ai-chat',
current: isAiChat,
content: (
<>
<span>AI Chat</span>
<span className="ml-1 rounded-md bg-yellow-50 dark:bg-yellow-900/30 px-1.5 py-0.5 text-xs font-medium text-yellow-600 dark:text-yellow-400">
beta
</span>
</>
),
},
];

const communityLinks = [
Expand Down

0 comments on commit b3bc436

Please sign in to comment.