1- import React , { useState } from 'react' ;
1+ import React from 'react' ;
22import ReactMarkdown from 'react-markdown' ;
33import remarkGfm from 'remark-gfm' ;
44import rehypeRaw from 'rehype-raw' ;
@@ -8,16 +8,14 @@ import { readFileSync } from 'fs';
88import { join } from 'path' ;
99import Head from 'next/head' ;
1010import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter' ;
11- import { oneDark } from 'react-syntax-highlighter/dist/esm /styles/prism' ;
11+ import { vscDarkPlus } from 'react-syntax-highlighter/dist/cjs /styles/prism' ;
1212
1313interface DocsPageProps {
1414 content : string ;
1515 headings : Array < { id : string ; text : string ; level : number } > ;
1616}
1717
1818export default function DocsPage ( { content, headings } : DocsPageProps ) {
19- const [ showToc , setShowToc ] = useState ( false ) ;
20-
2119 return (
2220 < >
2321 < Head >
@@ -62,22 +60,6 @@ export default function DocsPage({ content, headings }: DocsPageProps) {
6260 } } >
6361 ← Back
6462 </ a >
65- < button
66- onClick = { ( ) => setShowToc ( ! showToc ) }
67- style = { {
68- padding : '0.5rem 1rem' ,
69- background : showToc ? '#0052FF' : 'white' ,
70- color : showToc ? 'white' : '#0052FF' ,
71- border : '1px solid #0052FF' ,
72- borderRadius : '8px' ,
73- cursor : 'pointer' ,
74- fontSize : '0.875rem' ,
75- fontWeight : '600' ,
76- transition : 'all 0.2s ease'
77- } }
78- >
79- { showToc ? 'Hide' : 'Show' } Navigation
80- </ button >
8163 </ div >
8264 </ div >
8365
@@ -89,8 +71,7 @@ export default function DocsPage({ content, headings }: DocsPageProps) {
8971 gap : '2rem'
9072 } } >
9173 { /* Table of Contents */ }
92- { showToc && (
93- < aside style = { {
74+ < aside style = { {
9475 width : '250px' ,
9576 flexShrink : 0 ,
9677 position : 'sticky' ,
@@ -142,7 +123,6 @@ export default function DocsPage({ content, headings }: DocsPageProps) {
142123 ) ) }
143124 </ nav >
144125 </ aside >
145- ) }
146126
147127 { /* Main Content */ }
148128 < main style = { {
@@ -261,7 +241,7 @@ export default function DocsPage({ content, headings }: DocsPageProps) {
261241
262242 return ! isInline && match ? (
263243 < SyntaxHighlighter
264- style = { oneDark }
244+ style = { vscDarkPlus }
265245 language = { match [ 1 ] }
266246 PreTag = "div"
267247 customStyle = { {
0 commit comments