File tree Expand file tree Collapse file tree 2 files changed +34
-17
lines changed Expand file tree Collapse file tree 2 files changed +34
-17
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ const Frame = styled.iframe`
11
11
border-width: 0;
12
12
` ;
13
13
14
- function PreviewFrame ( { fullView } ) {
14
+ function PreviewFrame ( { fullView, isOverlayVisible } ) {
15
15
const iframe = useRef ( ) ;
16
16
const previewUrl = getConfig ( 'PREVIEW_URL' ) ;
17
17
useEffect ( ( ) => {
@@ -28,28 +28,36 @@ function PreviewFrame({ fullView }) {
28
28
hid; microphone; magnetometer; midi; payment; usb; serial; vr; xr-spatial-tracking` ;
29
29
30
30
return (
31
- < Frame
32
- title = "sketch preview"
33
- src = { frameUrl }
34
- sandbox = { sandboxAttributes }
35
- allow = { allow }
36
- scrolling = "auto"
37
- allowtransparency
38
- allowpaymentrequest
39
- allowFullScreen
40
- frameBorder = "0"
41
- ref = { iframe }
42
- fullView = { fullView }
43
- />
31
+ < >
32
+ < div
33
+ className = "preview-frame-overlay"
34
+ style = { { display : isOverlayVisible ? 'block' : 'none' } }
35
+ />
36
+ < Frame
37
+ title = "sketch preview"
38
+ src = { frameUrl }
39
+ sandbox = { sandboxAttributes }
40
+ allow = { allow }
41
+ scrolling = "auto"
42
+ allowtransparency
43
+ allowpaymentrequest
44
+ allowFullScreen
45
+ frameBorder = "0"
46
+ ref = { iframe }
47
+ fullView = { fullView }
48
+ />
49
+ </ >
44
50
) ;
45
51
}
46
52
47
53
PreviewFrame . propTypes = {
48
- fullView : PropTypes . bool
54
+ fullView : PropTypes . bool ,
55
+ isOverlayVisible : PropTypes . bool
49
56
} ;
50
57
51
58
PreviewFrame . defaultProps = {
52
- fullView : false
59
+ fullView : false ,
60
+ isOverlayVisible : false
53
61
} ;
54
62
55
63
export default PreviewFrame ;
Original file line number Diff line number Diff line change @@ -173,7 +173,9 @@ const IDEView = () => {
173
173
primary = "second"
174
174
size = { ide . consoleIsExpanded ? consoleSize : 29 }
175
175
minSize = { 29 }
176
- onChange = { ( size ) => setConsoleSize ( size ) }
176
+ onChange = { ( size ) => {
177
+ setConsoleSize ( size ) ;
178
+ } }
177
179
allowResize = { ide . consoleIsExpanded }
178
180
className = "editor-preview-subpanel"
179
181
>
@@ -215,11 +217,18 @@ const IDEView = () => {
215
217
split = "horizontal"
216
218
primary = "second"
217
219
minSize = { 200 }
220
+ onChange = { ( ) => {
221
+ setIsOverlayVisible ( true ) ;
222
+ } }
223
+ onDragFinished = { ( ) => {
224
+ setIsOverlayVisible ( false ) ;
225
+ } }
218
226
>
219
227
< PreviewFrame
220
228
fullView
221
229
hide = { ! ide . isPlaying }
222
230
cmController = { cmRef . current }
231
+ isOverlayVisible = { isOverlayVisible }
223
232
/>
224
233
< Console />
225
234
</ SplitPane >
You can’t perform that action at this time.
0 commit comments