File tree Expand file tree Collapse file tree 2 files changed +25
-9
lines changed Expand file tree Collapse file tree 2 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -38,17 +38,20 @@ const Button = styled.button`
38
38
}
39
39
` ;
40
40
41
- const FloatingActionButton = ( props ) => {
41
+ const FloatingActionButton = ( { syncFileContent , offsetBottom } ) => {
42
42
const isPlaying = useSelector ( ( state ) => state . ide . isPlaying ) ;
43
43
const dispatch = useDispatch ( ) ;
44
44
45
45
return (
46
46
< Button
47
47
className = { classNames ( { stop : isPlaying } ) }
48
- style = { { paddingLeft : isPlaying ? 0 : remSize ( 5 ) } }
48
+ style = { {
49
+ paddingLeft : isPlaying ? 0 : remSize ( 5 ) ,
50
+ marginBottom : offsetBottom
51
+ } }
49
52
onClick = { ( ) => {
50
53
if ( ! isPlaying ) {
51
- props . syncFileContent ( ) ;
54
+ syncFileContent ( ) ;
52
55
dispatch ( startSketch ( ) ) ;
53
56
} else dispatch ( stopSketch ( ) ) ;
54
57
} }
@@ -59,7 +62,8 @@ const FloatingActionButton = (props) => {
59
62
} ;
60
63
61
64
FloatingActionButton . propTypes = {
62
- syncFileContent : PropTypes . func . isRequired
65
+ syncFileContent : PropTypes . func . isRequired ,
66
+ offsetBottom : PropTypes . number . isRequired
63
67
} ;
64
68
65
69
export default FloatingActionButton ;
Original file line number Diff line number Diff line change @@ -127,6 +127,11 @@ const IDEView = () => {
127
127
} ;
128
128
} , [ shouldAutosave , dispatch ] ) ;
129
129
130
+ const consoleCollapsedSize = 29 ;
131
+ const currentConsoleSize = ide . consoleIsExpanded
132
+ ? consoleSize
133
+ : consoleCollapsedSize ;
134
+
130
135
return (
131
136
< RootPage >
132
137
< Helmet >
@@ -171,8 +176,8 @@ const IDEView = () => {
171
176
< SplitPane
172
177
split = "horizontal"
173
178
primary = "second"
174
- size = { ide . consoleIsExpanded ? consoleSize : 29 }
175
- minSize = { 29 }
179
+ size = { currentConsoleSize }
180
+ minSize = { consoleCollapsedSize }
176
181
onChange = { ( size ) => {
177
182
setConsoleSize ( size ) ;
178
183
} }
@@ -204,19 +209,26 @@ const IDEView = () => {
204
209
</ main >
205
210
) : (
206
211
< >
207
- < FloatingActionButton syncFileContent = { syncFileContent } />
212
+ < FloatingActionButton
213
+ syncFileContent = { syncFileContent }
214
+ offsetBottom = { ide . isPlaying ? currentConsoleSize : 0 }
215
+ />
208
216
< PreviewWrapper show = { ide . isPlaying } >
209
217
< SplitPane
210
218
style = { { position : 'static' } }
211
219
split = "horizontal"
212
220
primary = "second"
213
- minSize = { 200 }
214
- onChange = { ( ) => {
221
+ size = { currentConsoleSize }
222
+ minSize = { consoleCollapsedSize }
223
+ onChange = { ( size ) => {
224
+ setConsoleSize ( size ) ;
215
225
setIsOverlayVisible ( true ) ;
216
226
} }
217
227
onDragFinished = { ( ) => {
218
228
setIsOverlayVisible ( false ) ;
219
229
} }
230
+ allowResize = { ide . consoleIsExpanded }
231
+ className = "editor-preview-subpanel"
220
232
>
221
233
< PreviewFrame
222
234
fullView
You can’t perform that action at this time.
0 commit comments