File tree 2 files changed +21
-16
lines changed
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.
20
20
21
21
Here we use the [ _ ` require("@next/mdx") ` _ ] ( focus://1,6,8 ) plugin to set up MDX imports.
22
22
23
- <CH.Preview >
23
+ <CH.Preview frameless >
24
24
<div >Step 1</div >
25
25
<div >Step 1</div >
26
26
<div >Step 1</div >
Original file line number Diff line number Diff line change @@ -17,38 +17,43 @@ export function Preview({
17
17
children,
18
18
codeConfig,
19
19
style,
20
+ frameless,
20
21
...rest
21
22
} : {
22
23
className : string
24
+ frameless ?: boolean
23
25
files : EditorStep [ "files" ]
24
26
presetConfig ?: PresetConfig
25
27
show ?: string
26
28
style ?: React . CSSProperties
27
29
children ?: React . ReactNode
28
30
codeConfig : { theme : EditorTheme }
29
31
} ) {
32
+ const kids = presetConfig ? (
33
+ < SandpackPreview
34
+ files = { files }
35
+ presetConfig = { presetConfig }
36
+ />
37
+ ) : (
38
+ children
39
+ )
30
40
return (
31
41
< div
32
42
className = {
33
43
"ch-preview" + ( className ? " " + className : "" )
34
44
}
35
45
style = { style }
36
46
>
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
+ ) }
52
57
</ div >
53
58
)
54
59
}
You can’t perform that action at this time.
0 commit comments