@@ -74,16 +74,14 @@ const getNatOptions = (username = undefined) =>
74
74
75
75
const MobileIDEView = ( props ) => {
76
76
const {
77
- preferences, ide, editorAccessibility, project, updateLintMessage, clearLintMessage,
78
- selectedFile, updateFileContent, files, user, params,
79
- closeEditorOptions, showEditorOptions, unsavedChanges,
80
- startRefreshSketch, stopSketch, expandSidebar, collapseSidebar, clearConsole, console,
81
- showRuntimeErrorWarning, hideRuntimeErrorWarning, startSketch, getProject, clearPersistedState
77
+ ide, project, selectedFile, user, params,
78
+ stopSketch, startSketch, getProject, clearPersistedState
82
79
} = props ;
83
80
84
81
const [ tmController , setTmController ] = useState ( null ) ; // eslint-disable-line
85
82
86
83
const { username } = user ;
84
+ const { unsavedChanges } = ide ;
87
85
88
86
const [ triggerNavDropdown , NavDropDown ] = useAsModal ( < Dropdown
89
87
items = { getNatOptions ( username ) }
@@ -127,38 +125,7 @@ const MobileIDEView = (props) => {
127
125
</ Header >
128
126
129
127
< IDEWrapper >
130
- < Editor
131
- lintWarning = { preferences . lintWarning }
132
- linewrap = { preferences . linewrap }
133
- lintMessages = { editorAccessibility . lintMessages }
134
- updateLintMessage = { updateLintMessage }
135
- clearLintMessage = { clearLintMessage }
136
- file = { selectedFile }
137
- updateFileContent = { updateFileContent }
138
- fontSize = { preferences . fontSize }
139
- lineNumbers = { preferences . lineNumbers }
140
- files = { files }
141
- editorOptionsVisible = { ide . editorOptionsVisible }
142
- showEditorOptions = { showEditorOptions }
143
- closeEditorOptions = { closeEditorOptions }
144
- showKeyboard = { ide . isPlaying }
145
- theme = { preferences . theme }
146
- startRefreshSketch = { startRefreshSketch }
147
- stopSketch = { stopSketch }
148
- autorefresh = { preferences . autorefresh }
149
- unsavedChanges = { ide . unsavedChanges }
150
- projectSavedTime = { project . updatedAt }
151
- isExpanded = { ide . sidebarIsExpanded }
152
- expandSidebar = { expandSidebar }
153
- collapseSidebar = { collapseSidebar }
154
- isUserOwner = { isUserOwner ( props ) }
155
- clearConsole = { clearConsole }
156
- consoleEvents = { console }
157
- showRuntimeErrorWarning = { showRuntimeErrorWarning }
158
- hideRuntimeErrorWarning = { hideRuntimeErrorWarning }
159
- runtimeErrorWarningVisible = { ide . runtimeErrorWarningVisible }
160
- provideController = { setTmController }
161
- />
128
+ < Editor provideController = { setTmController } />
162
129
</ IDEWrapper >
163
130
164
131
< Footer >
@@ -203,7 +170,6 @@ MobileIDEView.propTypes = {
203
170
shareModalProjectUsername : PropTypes . string . isRequired ,
204
171
editorOptionsVisible : PropTypes . bool . isRequired ,
205
172
keyboardShortcutVisible : PropTypes . bool . isRequired ,
206
- unsavedChanges : PropTypes . bool . isRequired ,
207
173
infiniteLoop : PropTypes . bool . isRequired ,
208
174
previewIsRefreshing : PropTypes . bool . isRequired ,
209
175
infiniteLoopMessage : PropTypes . string . isRequired ,
@@ -213,6 +179,8 @@ MobileIDEView.propTypes = {
213
179
errorType : PropTypes . string ,
214
180
runtimeErrorWarningVisible : PropTypes . bool . isRequired ,
215
181
uploadFileModalVisible : PropTypes . bool . isRequired ,
182
+
183
+ unsavedChanges : PropTypes . bool . isRequired ,
216
184
} ) . isRequired ,
217
185
218
186
editorAccessibility : PropTypes . shape ( {
@@ -230,48 +198,15 @@ MobileIDEView.propTypes = {
230
198
} ) . isRequired ,
231
199
232
200
startSketch : PropTypes . func . isRequired ,
201
+ stopSketch : PropTypes . func . isRequired ,
233
202
234
- updateLintMessage : PropTypes . func . isRequired ,
235
-
236
- clearLintMessage : PropTypes . func . isRequired ,
237
203
238
204
selectedFile : PropTypes . shape ( {
239
205
id : PropTypes . string . isRequired ,
240
206
content : PropTypes . string . isRequired ,
241
207
name : PropTypes . string . isRequired ,
242
208
} ) . isRequired ,
243
209
244
- updateFileContent : PropTypes . func . isRequired ,
245
-
246
- files : PropTypes . arrayOf ( PropTypes . shape ( {
247
- id : PropTypes . string . isRequired ,
248
- name : PropTypes . string . isRequired ,
249
- content : PropTypes . string . isRequired ,
250
- } ) ) . isRequired ,
251
-
252
- closeEditorOptions : PropTypes . func . isRequired ,
253
-
254
- showEditorOptions : PropTypes . func . isRequired ,
255
-
256
- startRefreshSketch : PropTypes . func . isRequired ,
257
-
258
- stopSketch : PropTypes . func . isRequired ,
259
-
260
- expandSidebar : PropTypes . func . isRequired ,
261
-
262
- collapseSidebar : PropTypes . func . isRequired ,
263
-
264
- clearConsole : PropTypes . func . isRequired ,
265
-
266
- console : PropTypes . arrayOf ( PropTypes . shape ( {
267
- method : PropTypes . string . isRequired ,
268
- args : PropTypes . arrayOf ( PropTypes . string ) ,
269
- } ) ) . isRequired ,
270
-
271
- showRuntimeErrorWarning : PropTypes . func . isRequired ,
272
-
273
- hideRuntimeErrorWarning : PropTypes . func . isRequired ,
274
-
275
210
user : PropTypes . shape ( {
276
211
authenticated : PropTypes . bool . isRequired ,
277
212
id : PropTypes . string ,
@@ -284,8 +219,6 @@ MobileIDEView.propTypes = {
284
219
project_id : PropTypes . string ,
285
220
username : PropTypes . string
286
221
} ) . isRequired ,
287
-
288
- unsavedChanges : PropTypes . bool . isRequired
289
222
} ;
290
223
291
224
function mapStateToProps ( state ) {
@@ -297,6 +230,7 @@ function mapStateToProps(state) {
297
230
state . files . find ( file => file . name !== 'root' ) ,
298
231
htmlFile : getHTMLFile ( state . files ) ,
299
232
ide : state . ide ,
233
+ unsavedChanges : state . ide . unsavedChanged ,
300
234
preferences : state . preferences ,
301
235
editorAccessibility : state . editorAccessibility ,
302
236
user : state . user ,
0 commit comments