Skip to content

Commit 398b277

Browse files
Fix mweb console && floating action button
1 parent 42dec8d commit 398b277

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

client/modules/IDE/components/FloatingActionButton.jsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,20 @@ const Button = styled.button`
3838
}
3939
`;
4040

41-
const FloatingActionButton = (props) => {
41+
const FloatingActionButton = ({ syncFileContent, offsetBottom }) => {
4242
const isPlaying = useSelector((state) => state.ide.isPlaying);
4343
const dispatch = useDispatch();
4444

4545
return (
4646
<Button
4747
className={classNames({ stop: isPlaying })}
48-
style={{ paddingLeft: isPlaying ? 0 : remSize(5) }}
48+
style={{
49+
paddingLeft: isPlaying ? 0 : remSize(5),
50+
bottom: offsetBottom
51+
}}
4952
onClick={() => {
5053
if (!isPlaying) {
51-
props.syncFileContent();
54+
syncFileContent();
5255
dispatch(startSketch());
5356
} else dispatch(stopSketch());
5457
}}
@@ -59,7 +62,8 @@ const FloatingActionButton = (props) => {
5962
};
6063

6164
FloatingActionButton.propTypes = {
62-
syncFileContent: PropTypes.func.isRequired
65+
syncFileContent: PropTypes.func.isRequired,
66+
offsetBottom: PropTypes.number.isRequired
6367
};
6468

6569
export default FloatingActionButton;

client/modules/IDE/pages/IDEView.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,20 @@ const IDEView = () => {
208208
</main>
209209
) : (
210210
<>
211-
<FloatingActionButton syncFileContent={syncFileContent} />
211+
<FloatingActionButton
212+
syncFileContent={syncFileContent}
213+
offsetBottom={ide.isPlaying ? consoleSize : 0}
214+
/>
212215
<PreviewWrapper show={ide.isPlaying}>
213216
<SplitPane
214217
style={{ position: 'static' }}
215218
split="horizontal"
216219
primary="second"
217-
minSize={200}
220+
size={ide.consoleIsExpanded ? consoleSize : 29}
221+
minSize={29}
222+
onChange={(size) => setConsoleSize(size)}
223+
allowResize={ide.consoleIsExpanded}
224+
className="editor-preview-subpanel"
218225
>
219226
<PreviewFrame
220227
fullView

0 commit comments

Comments
 (0)