Skip to content

The only tool you need to know what is happening and how to fix it.

docsa navigation and presentation updates

dduxda6a65fd6437
diff --git a/docs/components/SdkContext.jsx b/docs/components/SdkContext.jsx
index ff4b706d..5e32b827 100644
--- a/docs/components/SdkContext.jsx
+++ b/docs/components/SdkContext.jsx
@@ -129,11 +129,7 @@ export function SdkProvider({ children }) {
if (!VALID_VALUES.has(value)) return
setSdkState(value)
localStorage.setItem(STORAGE_KEY, value)
-
- const url = new URL(window.location.href)
- url.searchParams.set('sdk', value)
- router.replace(url.pathname + url.search, undefined, { shallow: true })
- }, [router])
+ }, [])
return (
<SdkContext.Provider value={{ sdk, setSdk }}>
diff --git a/docs/pages/_app.jsx b/docs/pages/_app.jsx
index 6d4f23c6..6bb94c61 100644
--- a/docs/pages/_app.jsx
+++ b/docs/pages/_app.jsx
@@ -1,7 +1,16 @@
+import { useEffect } from 'react'
+import { useRouter } from 'next/router'
import '../styles/custom.css'
import { SdkProvider } from '../components/SdkContext'
export default function App({ Component, pageProps }) {
+ const router = useRouter()
+
+ useEffect(() => {
+ const path = router.pathname.replace(/\//g, '-').replace(/^-/, '') || 'index'
+ document.body.setAttribute('data-page', path)
+ }, [router.pathname])
+
return (
<SdkProvider>
<Component {...pageProps} />
diff --git a/docs/styles/custom.css b/docs/styles/custom.css
index 84b25700..d1f3c710 100644
--- a/docs/styles/custom.css
+++ b/docs/styles/custom.css
@@ -54,8 +54,7 @@ li:has(> .sdk-selector) > span:first-child {
border: 1px solid #e5e7eb;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
- z-index: 50;
- overflow: hidden;
+ z-index: 100;
}
.sdk-selector-search {
@@ -65,10 +64,16 @@ li:has(> .sdk-selector) > span:first-child {
border: none;
border-bottom: 1px solid #e5e7eb;
outline: none;
+ box-shadow: none;
background: transparent;
color: #111827;
}
+.sdk-selector-search:focus {
+ outline: none;
+ box-shadow: none;
+}
+
.sdk-selector-search::placeholder {
color: #9ca3af;
}
@@ -77,6 +82,8 @@ li:has(> .sdk-selector) > span:first-child {
list-style: none !important;
margin: 0 !important;
padding: 4px !important;
+ max-height: 240px;
+ overflow-y: auto;
}
.sdk-selector-list li {
@@ -231,6 +238,11 @@ li:has(> .sdk-selector) > span:first-child {
color: #e5e7eb;
}
+:is(html[class~="dark"]) .sdk-selector-search:focus {
+ outline: none;
+ box-shadow: none;
+}
+
:is(html[class~="dark"]) .sdk-selector-search::placeholder {
color: #6b7280;
}
@@ -247,3 +259,26 @@ li:has(> .sdk-selector) > span:first-child {
background: #1e3a5f;
color: #60a5fa;
}
+
+/* Protocol page - hide sidebar placeholder to expand content */
+body[data-page="protocol"] .nx-mx-auto.nx-flex > div.nx-w-64.nx-shrink-0,
+body[data-page^="protocol"] .nx-mx-auto.nx-flex > div.nx-w-64.nx-shrink-0 {
+ display: none !important;
+}
+
+/* Client index page - full width content on large screens */
+@media (min-width: 1280px) {
+ /* Hide left sidebar placeholder */
+ body[data-page="client"] .nx-mx-auto.nx-flex > div.nx-w-64.nx-shrink-0 {
+ display: none !important;
+ }
+
+ /* Hide right TOC */
+ body[data-page="client"] nav.nextra-toc {
+ display: none !important;
+ }
+
+ body[data-page="client"] main.nx-max-w-6xl {
+ max-width: none !important;
+ }
+}