docs: better code snippets (#2801)
Uses sandpack in all places so we can do richer code snippets. Also, drive-by fix to fix sidebar logic. Also, drive-by fix to hide keyboard hint (Cmd+K) for search on mobile. ### Change Type - [x] `documentation` — Changes to the documentation only[^2] ### Release Notes - Docs: reworks code snippets
This commit is contained in:
parent
a5e6ae87fe
commit
430924f8b6
9 changed files with 97 additions and 44 deletions
|
@ -1,6 +1,6 @@
|
|||
'use client'
|
||||
|
||||
import { SandpackCodeEditor, SandpackFiles, SandpackProvider } from '@codesandbox/sandpack-react'
|
||||
import { SandpackCodeViewer, SandpackFiles, SandpackProvider } from '@codesandbox/sandpack-react'
|
||||
import { useTheme } from 'next-themes'
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
|
@ -43,7 +43,7 @@ export default function ExampleCodeBlock({
|
|||
}}
|
||||
theme={theme === 'dark' ? 'dark' : 'light'}
|
||||
>
|
||||
<SandpackCodeEditor readOnly />
|
||||
<SandpackCodeViewer />
|
||||
</SandpackProvider>
|
||||
</div>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue