@@ -8,6 +8,8 @@ import Header from '../../components/mobile/Header';
8
8
import PreviewFrame from '../IDE/components/PreviewFrame' ;
9
9
import Screen from '../../components/mobile/MobileScreen' ;
10
10
import * as ProjectActions from '../IDE/actions/project' ;
11
+ import * as IDEActions from '../IDE/actions/ide' ;
12
+
11
13
import { getHTMLFile , getJSFiles , getCSSFiles } from '../IDE/reducers/files' ;
12
14
13
15
@@ -39,13 +41,16 @@ const MobileSketchView = (props) => {
39
41
// const files = useSelector(state => state.files);
40
42
41
43
const {
42
- htmlFile, jsFiles, cssFiles, files, params, getProject
44
+ htmlFile, jsFiles, cssFiles, files, params
43
45
} = props ;
44
46
45
- useEffect ( ( ) => {
46
- console . log ( params ) ;
47
- getProject ( params . project_id , params . username ) ;
48
- } , [ ] ) ;
47
+ // Actions
48
+ const { getProject, startSketch } = props ;
49
+
50
+ // useEffect(() => {
51
+ // console.log(params);
52
+ // getProject(params.project_id, params.username);
53
+ // }, []);
49
54
50
55
return (
51
56
< Screen >
@@ -55,42 +60,35 @@ const MobileSketchView = (props) => {
55
60
</ IconLinkWrapper >
56
61
< div >
57
62
< h2 > Hello</ h2 >
58
- { /* <h3>{selectedFile.name}</h3> */ }
63
+ < h3 > < br /> </ h3 >
59
64
</ div >
60
-
61
- { /* <div style={{ marginLeft: '2rem' }}>
62
- <IconButton onClick={() => setOverlay('preferences')}>
63
- <PreferencesIcon focusable="false" aria-hidden="true" />
64
- </IconButton>
65
- <IconButton onClick={() => setOverlay('runSketch')}>
66
- <PlayIcon viewBox="-1 -1 7 7" focusable="false" aria-hidden="true" />
67
- </IconButton>
68
- </div> */ }
69
65
</ Header >
70
66
< Content >
71
67
< h1 > Hello</ h1 >
72
- < PreviewFrame
73
- htmlFile = { htmlFile }
74
- jsFiles = { jsFiles }
75
- cssFiles = { cssFiles }
76
- files = { files }
77
- head = {
78
- < link type = "text/css" rel = "stylesheet" href = "/preview-styles.css" />
79
- }
80
- fullView
81
- isPlaying
82
- isAccessibleOutputPlaying = { false }
83
- textOutput = { false }
84
- gridOutput = { false }
85
- soundOutput = { false }
86
- dispatchConsoleEvent = { noop }
87
- endSketchRefresh = { noop }
88
- previewIsRefreshing = { false }
89
- setBlobUrl = { noop }
90
- stopSketch = { noop }
91
- expandConsole = { noop }
92
- clearConsole = { noop }
93
- />
68
+ < main className = "preview-frame-holder" >
69
+
70
+ < PreviewFrame
71
+ fullView
72
+ isPlaying
73
+ htmlFile = { htmlFile }
74
+ jsFiles = { jsFiles }
75
+ cssFiles = { cssFiles }
76
+ files = { files }
77
+ head = { < link type = "text/css" rel = "stylesheet" href = "/preview-styles.css" /> }
78
+ isAccessibleOutputPlaying = { false }
79
+ textOutput = { false }
80
+ gridOutput = { false }
81
+ soundOutput = { false }
82
+ previewIsRefreshing = { false }
83
+
84
+ dispatchConsoleEvent = { noop }
85
+ endSketchRefresh = { noop }
86
+ setBlobUrl = { noop }
87
+ stopSketch = { noop }
88
+ expandConsole = { noop }
89
+ clearConsole = { noop }
90
+ />
91
+ </ main >
94
92
</ Content >
95
93
</ Screen > ) ;
96
94
} ;
@@ -121,6 +119,7 @@ MobileSketchView.propTypes = {
121
119
name : PropTypes . string . isRequired
122
120
} ) ) . isRequired ,
123
121
getProject : PropTypes . func . isRequired ,
122
+ startSketch : PropTypes . func . isRequired ,
124
123
} ;
125
124
126
125
function mapStateToProps ( state ) {
@@ -134,7 +133,7 @@ function mapStateToProps(state) {
134
133
}
135
134
136
135
function mapDispatchToProps ( dispatch ) {
137
- return bindActionCreators ( ProjectActions , dispatch ) ;
136
+ return bindActionCreators ( { ... ProjectActions , ... IDEActions } , dispatch ) ;
138
137
}
139
138
140
139
export default connect ( mapStateToProps , mapDispatchToProps ) ( MobileSketchView ) ;
0 commit comments