@@ -11,7 +11,6 @@ import { bindActionCreators } from 'redux';
11
11
import * as FileActions from '../actions/files' ;
12
12
import * as IDEActions from '../actions/ide' ;
13
13
import * as ProjectActions from '../actions/project' ;
14
- import * as EditorAccessibilityActions from '../actions/editorAccessibility' ;
15
14
import * as PreferencesActions from '../actions/preferences' ;
16
15
import * as UserActions from '../../User/actions' ;
17
16
import * as ToastActions from '../actions/toast' ;
@@ -74,14 +73,15 @@ const getNatOptions = (username = undefined) =>
74
73
75
74
const MobileIDEView = ( props ) => {
76
75
const {
77
- ide, project, selectedFile, user, params,
76
+ ide, project, selectedFile, user, params, unsavedChanges ,
78
77
stopSketch, startSketch, getProject, clearPersistedState
79
78
} = props ;
80
79
81
80
const [ tmController , setTmController ] = useState ( null ) ; // eslint-disable-line
82
81
83
82
const { username } = user ;
84
- const { unsavedChanges } = ide ;
83
+ const { consoleIsExpanded } = ide ;
84
+ const { name : filename } = selectedFile ;
85
85
86
86
const [ triggerNavDropdown , NavDropDown ] = useAsModal ( < Dropdown
87
87
items = { getNatOptions ( username ) }
@@ -109,7 +109,7 @@ const MobileIDEView = (props) => {
109
109
< Screen fullscreen >
110
110
< Header
111
111
title = { withChangeDot ( project . name , unsavedChanges ) }
112
- subtitle = { selectedFile . name }
112
+ subtitle = { filename }
113
113
>
114
114
< NavItem >
115
115
< IconButton
@@ -129,7 +129,7 @@ const MobileIDEView = (props) => {
129
129
</ IDEWrapper >
130
130
131
131
< Footer >
132
- { ide . consoleIsExpanded && (
132
+ { consoleIsExpanded && (
133
133
< Expander expanded >
134
134
< Console />
135
135
</ Expander >
@@ -141,50 +141,8 @@ const MobileIDEView = (props) => {
141
141
} ;
142
142
143
143
MobileIDEView . propTypes = {
144
- preferences : PropTypes . shape ( {
145
- fontSize : PropTypes . number . isRequired ,
146
- autosave : PropTypes . bool . isRequired ,
147
- linewrap : PropTypes . bool . isRequired ,
148
- lineNumbers : PropTypes . bool . isRequired ,
149
- lintWarning : PropTypes . bool . isRequired ,
150
- textOutput : PropTypes . bool . isRequired ,
151
- gridOutput : PropTypes . bool . isRequired ,
152
- soundOutput : PropTypes . bool . isRequired ,
153
- theme : PropTypes . string . isRequired ,
154
- autorefresh : PropTypes . bool . isRequired ,
155
- } ) . isRequired ,
156
-
157
144
ide : PropTypes . shape ( {
158
- isPlaying : PropTypes . bool . isRequired ,
159
- isAccessibleOutputPlaying : PropTypes . bool . isRequired ,
160
- consoleEvent : PropTypes . array ,
161
- modalIsVisible : PropTypes . bool . isRequired ,
162
- sidebarIsExpanded : PropTypes . bool . isRequired ,
163
145
consoleIsExpanded : PropTypes . bool . isRequired ,
164
- preferencesIsVisible : PropTypes . bool . isRequired ,
165
- projectOptionsVisible : PropTypes . bool . isRequired ,
166
- newFolderModalVisible : PropTypes . bool . isRequired ,
167
- shareModalVisible : PropTypes . bool . isRequired ,
168
- shareModalProjectId : PropTypes . string . isRequired ,
169
- shareModalProjectName : PropTypes . string . isRequired ,
170
- shareModalProjectUsername : PropTypes . string . isRequired ,
171
- editorOptionsVisible : PropTypes . bool . isRequired ,
172
- keyboardShortcutVisible : PropTypes . bool . isRequired ,
173
- infiniteLoop : PropTypes . bool . isRequired ,
174
- previewIsRefreshing : PropTypes . bool . isRequired ,
175
- infiniteLoopMessage : PropTypes . string . isRequired ,
176
- projectSavedTime : PropTypes . string ,
177
- previousPath : PropTypes . string . isRequired ,
178
- justOpenedProject : PropTypes . bool . isRequired ,
179
- errorType : PropTypes . string ,
180
- runtimeErrorWarningVisible : PropTypes . bool . isRequired ,
181
- uploadFileModalVisible : PropTypes . bool . isRequired ,
182
-
183
- unsavedChanges : PropTypes . bool . isRequired ,
184
- } ) . isRequired ,
185
-
186
- editorAccessibility : PropTypes . shape ( {
187
- lintMessages : PropTypes . array . isRequired ,
188
146
} ) . isRequired ,
189
147
190
148
project : PropTypes . shape ( {
@@ -194,12 +152,8 @@ MobileIDEView.propTypes = {
194
152
username : PropTypes . string ,
195
153
id : PropTypes . string ,
196
154
} ) ,
197
- updatedAt : PropTypes . string ,
198
155
} ) . isRequired ,
199
156
200
- startSketch : PropTypes . func . isRequired ,
201
- stopSketch : PropTypes . func . isRequired ,
202
-
203
157
204
158
selectedFile : PropTypes . shape ( {
205
159
id : PropTypes . string . isRequired ,
@@ -213,12 +167,17 @@ MobileIDEView.propTypes = {
213
167
username : PropTypes . string ,
214
168
} ) . isRequired ,
215
169
216
- getProject : PropTypes . func . isRequired ,
217
- clearPersistedState : PropTypes . func . isRequired ,
218
170
params : PropTypes . shape ( {
219
171
project_id : PropTypes . string ,
220
172
username : PropTypes . string
221
173
} ) . isRequired ,
174
+
175
+ unsavedChanges : PropTypes . bool . isRequired ,
176
+
177
+ startSketch : PropTypes . func . isRequired ,
178
+ stopSketch : PropTypes . func . isRequired ,
179
+ getProject : PropTypes . func . isRequired ,
180
+ clearPersistedState : PropTypes . func . isRequired ,
222
181
} ;
223
182
224
183
function mapStateToProps ( state ) {
@@ -230,9 +189,8 @@ function mapStateToProps(state) {
230
189
state . files . find ( file => file . name !== 'root' ) ,
231
190
htmlFile : getHTMLFile ( state . files ) ,
232
191
ide : state . ide ,
233
- unsavedChanges : state . ide . unsavedChanged ,
192
+ unsavedChanges : state . ide . unsavedChanges ,
234
193
preferences : state . preferences ,
235
- editorAccessibility : state . editorAccessibility ,
236
194
user : state . user ,
237
195
project : state . project ,
238
196
toast : state . toast ,
@@ -244,14 +202,8 @@ function mapDispatchToProps(dispatch) {
244
202
return bindActionCreators (
245
203
Object . assign (
246
204
{ } ,
247
- EditorAccessibilityActions ,
248
- FileActions ,
249
205
ProjectActions ,
250
206
IDEActions ,
251
- PreferencesActions ,
252
- UserActions ,
253
- ToastActions ,
254
- ConsoleActions
255
207
) ,
256
208
dispatch
257
209
) ;
0 commit comments