Skip to content

Commit b20e174

Browse files
committed
fix build
1 parent 0bb8aff commit b20e174

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/components/DocsLayout.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { Link, useMatches, useParams } from '@tanstack/react-router'
55
import { useLocalStorage } from '~/utils/useLocalStorage'
66
import { last } from '~/utils/utils'
77
import type { ConfigSchema, MenuItem } from '~/utils/config'
8-
import { Framework, frameworkOptions } from '~/libraries'
8+
import { Framework } from '~/libraries'
9+
import { frameworkOptions } from '~/libraries/frameworks'
910
import { DocsCalloutQueryGG } from '~/components/DocsCalloutQueryGG'
1011
import { twMerge } from 'tailwind-merge'
1112
import { partners, PartnerImage } from '~/utils/partners'
@@ -15,6 +16,15 @@ import { SearchButton } from './SearchButton'
1516
import { FrameworkSelect, useCurrentFramework } from './FrameworkSelect'
1617
import { VersionSelect } from './VersionSelect'
1718

19+
// Helper to get text color class from framework badge
20+
const getFrameworkTextColor = (frameworkValue: string | undefined) => {
21+
if (!frameworkValue) return 'text-gray-500'
22+
const framework = frameworkOptions.find((f) => f.value === frameworkValue)
23+
if (!framework) return 'text-gray-500'
24+
// Convert bg-* to text-* color class
25+
return framework.color.replace('bg-', 'text-')
26+
}
27+
1828
// Create context for width toggle state
1929
const WidthToggleContext = React.createContext<{
2030
isFullWidth: boolean
@@ -247,11 +257,9 @@ export function DocsLayout({
247257
<div
248258
className={`text-xs ${
249259
props.isActive ? 'opacity-100' : 'opacity-40'
250-
} group-hover:opacity-100 font-bold transition-opacity ${
251-
frameworkOptions.find(
252-
(f) => f.value === child.badge
253-
)?.fontColor ?? 'text-gray-500'
254-
}`}
260+
} group-hover:opacity-100 font-bold transition-opacity ${getFrameworkTextColor(
261+
child.badge
262+
)}`}
255263
>
256264
{child.badge}
257265
</div>

0 commit comments

Comments
 (0)