File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ export const CodeEmbed = (props) => {
34
34
initialCode . replace ( / \u00A0 / g, " " ) ,
35
35
) ;
36
36
37
+ const largeSketch = props . previewWidth && props . previewWidth > 650 ;
38
+
37
39
const codeFrameRef = useRef ( null ) ;
38
40
39
41
const updateOrReRun = ( ) => {
@@ -61,11 +63,11 @@ export const CodeEmbed = (props) => {
61
63
62
64
return (
63
65
< div
64
- className = { `my-md flex w-full flex-col gap-[20px] overflow-hidden ${ props . allowSideBySide && "lg:flex-row" } ${ props . fullWidth && "full-width" } ` }
66
+ className = { `my-md flex w-full flex-col gap-[20px] overflow-hidden ${ props . allowSideBySide ? "lg:flex-row" : "" } ${ props . fullWidth ? "full-width" : " "} ` }
65
67
>
66
68
{ props . previewable ? (
67
69
< div
68
- className = { `ml-0 flex w-fit gap-[20px] ${ props . allowSideBySide ? "" : "flex-col lg:flex-row" } ` }
70
+ className = { `ml-0 flex w-fit gap-[20px] ${ largeSketch ? "flex-col" : ( props . allowSideBySide ? "" : "flex-col lg:flex-row" ) } ` }
69
71
>
70
72
< div >
71
73
< CodeFrame
@@ -77,7 +79,7 @@ export const CodeEmbed = (props) => {
77
79
lazyLoad = { props . lazyLoad }
78
80
/>
79
81
</ div >
80
- < div className = " flex gap-2.5 md:flex-row lg:flex-col">
82
+ < div className = { ` flex gap-2.5 ${ largeSketch ? "flex-row" : " md:flex-row lg:flex-col"} ` } >
81
83
< CircleButton
82
84
className = "bg-bg-gray-40"
83
85
onClick = { updateOrReRun }
You can’t perform that action at this time.
0 commit comments