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(nx-dev): add link to AI Chat beta in docs header #19261

Merged
merged 1 commit into from
Sep 26, 2023
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
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 @@ -67,8 +67,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
2 changes: 1 addition & 1 deletion nx-dev/nx-dev/pages/ai-chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function AiDocs(): JSX.Element {
return (
<>
<NextSeo
title="Nx AI Chat (Alpha)"
title="Nx AI Chat (Beta)"
description="AI chat powered by Nx docs."
noindex={true}
robotsProps={{
Expand Down
24 changes: 22 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 @@ -44,8 +45,14 @@ export function DocumentationHeader({
const isExtendingNx: boolean = routerPath.startsWith('/extending-nx');
const isPlugins: boolean = routerPath.startsWith('/plugin-registry');
const isChangelog: boolean = routerPath.startsWith('/changelog');
const isAiChat: boolean = router.asPath.startsWith('/ai-chat');
const isNx: boolean =
!isNxCloud && !isAPI && !isExtendingNx && !isPlugins && !isChangelog;
!isNxCloud &&
!isAPI &&
!isExtendingNx &&
!isPlugins &&
!isChangelog &&
!isAiChat;

const sections = [
{ name: 'Nx', href: '/getting-started/intro', current: isNx },
Expand Down Expand Up @@ -74,6 +81,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