Skip to content
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
9 changes: 0 additions & 9 deletions src/components/LibraryLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { ChevronLeft, ChevronRight, Menu, X } from 'lucide-react'
import { GithubIcon } from '~/components/icons/GithubIcon'
import { DiscordIcon } from '~/components/icons/DiscordIcon'
import { YouTubeIcon } from '~/components/icons/YouTubeIcon'
import { Link, useMatches, useParams } from '@tanstack/react-router'
import { useLocalStorage } from '~/utils/useLocalStorage'
import { useClickOutside } from '~/hooks/useClickOutside'
Expand Down Expand Up @@ -751,14 +750,6 @@
),
to: `https://github.com/${repo}`,
},
{
label: (
<div className="flex items-center gap-2">
YouTube <YouTubeIcon className="text-lg opacity-20" />
</div>
),
to: 'https://youtube.com/@tan_stack',
},
{
label: (
<div className="flex items-center gap-2">
Expand Down Expand Up @@ -1274,7 +1265,7 @@
<div className="flex items-stretch">
<label
htmlFor={mobileMenuToggleId}
role="button"

Check warning on line 1268 in src/components/LibraryLayout.tsx

View workflow job for this annotation

GitHub Actions / PR

eslint-plugin-jsx-a11y(prefer-tag-over-role)

Prefer `button` over `role` attribute `button`.
tabIndex={0}
aria-label="Documentation menu"
aria-expanded={mobileMenuOpen ? true : undefined}
Expand Down
15 changes: 10 additions & 5 deletions src/utils/docsNavTabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const docsNavTabIds = [
'guides',
'api',
'examples',
'community',
] as const

export type DocsNavTabId = (typeof docsNavTabIds)[number]
Expand All @@ -20,7 +19,6 @@ export const docsNavTabs: Array<{ id: DocsNavTabId; label: string }> = [
{ id: 'guides', label: 'Guides' },
{ id: 'api', label: 'API' },
{ id: 'examples', label: 'Examples' },
{ id: 'community', label: 'Community' },
]

function getLabelText(label: ReactNode) {
Expand All @@ -45,6 +43,7 @@ function getFallbackDocsNavTabId(
return 'home'
}

// Community resources now live under the Home tab.
if (
child.to.startsWith('http') ||
searchText.includes('community') ||
Expand All @@ -56,7 +55,7 @@ function getFallbackDocsNavTabId(
searchText.includes('discord') ||
searchText.includes('youtube')
) {
return 'community'
return 'home'
}

if (searchText.includes('example')) {
Expand Down Expand Up @@ -135,6 +134,11 @@ export function getTabbedMenuConfig(menuConfig: MenuItem[]) {
...tab,
groups,
firstItem:
// The Home tab points at the library landing page (`..`), even though
// it now also contains community docs (Blog, Contributors, etc.).
(tab.id === 'home'
? children.find((child) => child.to === '..')
: undefined) ??
children.find((child) => isDocsTabTarget(child.to)) ??
children.find((child) => !child.to.startsWith('http')),
}
Expand Down Expand Up @@ -218,9 +222,10 @@ export function getActiveDocsNavTabId({
if (
pathname.includes('/docs/community') ||
pathname.includes('/docs/contributors') ||
pathname.includes('/docs/npm-stats')
pathname.includes('/docs/npm-stats') ||
pathname.includes('/docs/blog')
) {
return 'community'
return 'home'
}

return 'get-started'
Expand Down
Loading