File tree Expand file tree Collapse file tree 2 files changed +21
-16
lines changed Expand file tree Collapse file tree 2 files changed +21
-16
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Create a `next.config.js` file at the root of your project.
2020
2121Here we use the [ _ ` require("@next/mdx") ` _ ] ( focus://1,6,8 ) plugin to set up MDX imports.
2222
23- <CH.Preview >
23+ <CH.Preview frameless >
2424 <div >Step 1</div >
2525 <div >Step 1</div >
2626 <div >Step 1</div >
Original file line number Diff line number Diff line change @@ -17,38 +17,43 @@ export function Preview({
1717 children,
1818 codeConfig,
1919 style,
20+ frameless,
2021 ...rest
2122} : {
2223 className : string
24+ frameless ?: boolean
2325 files : EditorStep [ "files" ]
2426 presetConfig ?: PresetConfig
2527 show ?: string
2628 style ?: React . CSSProperties
2729 children ?: React . ReactNode
2830 codeConfig : { theme : EditorTheme }
2931} ) {
32+ const kids = presetConfig ? (
33+ < SandpackPreview
34+ files = { files }
35+ presetConfig = { presetConfig }
36+ />
37+ ) : (
38+ children
39+ )
3040 return (
3141 < div
3242 className = {
3343 "ch-preview" + ( className ? " " + className : "" )
3444 }
3545 style = { style }
3646 >
37- < MiniBrowser
38- loadUrl = { show }
39- theme = { codeConfig . theme }
40- { ...rest }
41- children = {
42- presetConfig ? (
43- < SandpackPreview
44- files = { files }
45- presetConfig = { presetConfig }
46- />
47- ) : (
48- children
49- )
50- }
51- />
47+ { frameless ? (
48+ kids
49+ ) : (
50+ < MiniBrowser
51+ loadUrl = { show }
52+ theme = { codeConfig . theme }
53+ { ...rest }
54+ children = { kids }
55+ />
56+ ) }
5257 </ div >
5358 )
5459}
You can’t perform that action at this time.
0 commit comments