Skip to content

Commit ee0745d

Browse files
committed
random improvements
1 parent d26c8cc commit ee0745d

File tree

4 files changed

+9
-18
lines changed

4 files changed

+9
-18
lines changed

apps/docs/app/[lang]/[[...slug]]/page.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ import { StructuredData } from '@/components/structured-data'
1414
import { CodeBlock } from '@/components/ui/code-block'
1515
import { Heading } from '@/components/ui/heading'
1616
import { ResponseSection } from '@/components/ui/response-section'
17+
import { i18n } from '@/lib/i18n'
1718
import { getApiSpecContent, openapi } from '@/lib/openapi'
1819
import { type PageData, source } from '@/lib/source'
1920

20-
const SUPPORTED_LANGUAGES = new Set(['en', 'es', 'fr', 'de', 'ja', 'zh'])
21+
const SUPPORTED_LANGUAGES = new Set(i18n.languages)
2122

2223
const APIPage = createAPIPage(openapi, {
2324
playground: { enabled: false },
@@ -53,15 +54,14 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
5354

5455
const data = page.data as PageData & {
5556
_openapi?: { method?: string }
56-
getAPIPageProps?: () => any
57+
getAPIPageProps?: () => unknown
5758
}
5859
const isOpenAPI = '_openapi' in data && data._openapi != null
5960
const isApiReference = slug?.some((s) => s === 'api-reference') ?? false
6061
const baseUrl = 'https://docs.sim.ai'
6162

62-
const pageTreeRecord = source.pageTree as Record<string, any>
63-
const pageTree =
64-
pageTreeRecord[params.lang] ?? pageTreeRecord.en ?? Object.values(pageTreeRecord)[0]
63+
const pageTreeRecord = source.pageTree as Record<string, unknown>
64+
const pageTree = pageTreeRecord[lang] ?? pageTreeRecord.en ?? Object.values(pageTreeRecord)[0]
6565
const rawNeighbours = pageTree ? findNeighbour(pageTree, page.url) : null
6666
const neighbours = isApiReference
6767
? {
@@ -226,7 +226,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
226226
title={data.title}
227227
description={data.description || ''}
228228
url={`${baseUrl}${page.url}`}
229-
lang={params.lang}
229+
lang={lang}
230230
breadcrumb={breadcrumbs}
231231
/>
232232
<DocsPage
@@ -274,7 +274,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
274274
title={data.title}
275275
description={data.description || ''}
276276
url={`${baseUrl}${page.url}`}
277-
lang={params.lang}
277+
lang={lang}
278278
breadcrumb={breadcrumbs}
279279
/>
280280
<DocsPage

apps/docs/app/[lang]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ type LayoutProps = {
5555
params: Promise<{ lang: string }>
5656
}
5757

58-
const SUPPORTED_LANGUAGES = new Set(['en', 'es', 'fr', 'de', 'ja', 'zh'])
58+
const SUPPORTED_LANGUAGES = new Set(i18n.languages)
5959

6060
export default async function Layout({ children, params }: LayoutProps) {
6161
const { lang: rawLang } = await params

apps/docs/app/global.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ aside#nd-sidebar {
160160
#nd-sidebar > div {
161161
padding: 0.5rem 12px 12px;
162162
background: transparent !important;
163-
background-color: transparent !important;
164163
}
165164

166165
/* Override sidebar item styling to match Raindrop */

apps/docs/components/navbar/navbar.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,9 @@ import { SimLogoFull } from '@/components/ui/sim-logo'
88
import { ThemeToggle } from '@/components/ui/theme-toggle'
99
import { cn } from '@/lib/utils'
1010

11-
const navLinkStyle = {
12-
fontFamily:
13-
'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
14-
}
15-
1611
export function Navbar() {
1712
const pathname = usePathname()
18-
const isApiReference = pathname.startsWith('/api-reference')
13+
const isApiReference = pathname.includes('/api-reference')
1914

2015
return (
2116
<nav className='sticky top-0 z-50 border-border/50 border-b bg-background/80 backdrop-blur-md backdrop-saturate-150'>
@@ -48,7 +43,6 @@ export function Navbar() {
4843
'rounded-xl px-3 py-2 font-normal text-[0.9375rem] leading-[1.4] transition-colors hover:bg-foreground/8 hover:text-foreground',
4944
!isApiReference ? 'text-foreground' : 'text-foreground/60'
5045
)}
51-
style={navLinkStyle}
5246
>
5347
Documentation
5448
</Link>
@@ -58,7 +52,6 @@ export function Navbar() {
5852
'rounded-xl px-3 py-2 font-normal text-[0.9375rem] leading-[1.4] transition-colors hover:bg-foreground/8 hover:text-foreground',
5953
isApiReference ? 'text-foreground' : 'text-foreground/60'
6054
)}
61-
style={navLinkStyle}
6255
>
6356
API
6457
</Link>
@@ -67,7 +60,6 @@ export function Navbar() {
6760
target='_blank'
6861
rel='noopener noreferrer'
6962
className='rounded-xl px-3 py-2 font-normal text-[0.9375rem] text-foreground/60 leading-[1.4] transition-colors hover:bg-foreground/8 hover:text-foreground'
70-
style={navLinkStyle}
7163
>
7264
Platform
7365
</Link>

0 commit comments

Comments
 (0)