@@ -74,16 +74,14 @@ const getNatOptions = (username = undefined) =>
7474
7575const MobileIDEView = ( props ) => {
7676 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
8279 } = props ;
8380
8481 const [ tmController , setTmController ] = useState ( null ) ; // eslint-disable-line
8582
8683 const { username } = user ;
84+ const { unsavedChanges } = ide ;
8785
8886 const [ triggerNavDropdown , NavDropDown ] = useAsModal ( < Dropdown
8987 items = { getNatOptions ( username ) }
@@ -127,38 +125,7 @@ const MobileIDEView = (props) => {
127125 </ Header >
128126
129127 < 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 } />
162129 </ IDEWrapper >
163130
164131 < Footer >
@@ -203,7 +170,6 @@ MobileIDEView.propTypes = {
203170 shareModalProjectUsername : PropTypes . string . isRequired ,
204171 editorOptionsVisible : PropTypes . bool . isRequired ,
205172 keyboardShortcutVisible : PropTypes . bool . isRequired ,
206- unsavedChanges : PropTypes . bool . isRequired ,
207173 infiniteLoop : PropTypes . bool . isRequired ,
208174 previewIsRefreshing : PropTypes . bool . isRequired ,
209175 infiniteLoopMessage : PropTypes . string . isRequired ,
@@ -213,6 +179,8 @@ MobileIDEView.propTypes = {
213179 errorType : PropTypes . string ,
214180 runtimeErrorWarningVisible : PropTypes . bool . isRequired ,
215181 uploadFileModalVisible : PropTypes . bool . isRequired ,
182+
183+ unsavedChanges : PropTypes . bool . isRequired ,
216184 } ) . isRequired ,
217185
218186 editorAccessibility : PropTypes . shape ( {
@@ -230,48 +198,15 @@ MobileIDEView.propTypes = {
230198 } ) . isRequired ,
231199
232200 startSketch : PropTypes . func . isRequired ,
201+ stopSketch : PropTypes . func . isRequired ,
233202
234- updateLintMessage : PropTypes . func . isRequired ,
235-
236- clearLintMessage : PropTypes . func . isRequired ,
237203
238204 selectedFile : PropTypes . shape ( {
239205 id : PropTypes . string . isRequired ,
240206 content : PropTypes . string . isRequired ,
241207 name : PropTypes . string . isRequired ,
242208 } ) . isRequired ,
243209
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-
275210 user : PropTypes . shape ( {
276211 authenticated : PropTypes . bool . isRequired ,
277212 id : PropTypes . string ,
@@ -284,8 +219,6 @@ MobileIDEView.propTypes = {
284219 project_id : PropTypes . string ,
285220 username : PropTypes . string
286221 } ) . isRequired ,
287-
288- unsavedChanges : PropTypes . bool . isRequired
289222} ;
290223
291224function mapStateToProps ( state ) {
@@ -297,6 +230,7 @@ function mapStateToProps(state) {
297230 state . files . find ( file => file . name !== 'root' ) ,
298231 htmlFile : getHTMLFile ( state . files ) ,
299232 ide : state . ide ,
233+ unsavedChanges : state . ide . unsavedChanged ,
300234 preferences : state . preferences ,
301235 editorAccessibility : state . editorAccessibility ,
302236 user : state . user ,
0 commit comments