@@ -7,16 +7,10 @@ import { useTranslation, withTranslation } from 'react-i18next';
7
7
import { Helmet } from 'react-helmet' ;
8
8
import SplitPane from 'react-split-pane' ;
9
9
import Editor from '../components/Editor' ;
10
+ import IDEOverlays from '../components/IDEOverlays' ;
10
11
import IDEKeyHandlers from '../components/IDEKeyHandlers' ;
11
12
import Sidebar from '../components/Sidebar' ;
12
13
import PreviewFrame from '../components/PreviewFrame' ;
13
- import Preferences from '../components/Preferences/index' ;
14
- import NewFileModal from '../components/NewFileModal' ;
15
- import NewFolderModal from '../components/NewFolderModal' ;
16
- import UploadFileModal from '../components/UploadFileModal' ;
17
- import ShareModal from '../components/ShareModal' ;
18
- import KeyboardShortcutModal from '../components/KeyboardShortcutModal' ;
19
- import ErrorModal from '../components/ErrorModal' ;
20
14
import Console from '../components/Console' ;
21
15
import Toast from '../components/Toast' ;
22
16
import * as FileActions from '../actions/files' ;
@@ -27,11 +21,6 @@ import * as PreferencesActions from '../actions/preferences';
27
21
import * as UserActions from '../../User/actions' ;
28
22
import * as ConsoleActions from '../actions/console' ;
29
23
import { getHTMLFile } from '../reducers/files' ;
30
- import Overlay from '../../App/components/Overlay' ;
31
- import About from '../components/About' ;
32
- import AddToCollectionList from '../components/AddToCollectionList' ;
33
- import Feedback from '../components/Feedback' ;
34
- import { CollectionSearchbar } from '../components/Searchbar' ;
35
24
import { selectActiveFile } from '../selectors/files' ;
36
25
import { getIsUserOwner } from '../selectors/users' ;
37
26
import RootPage from '../../../components/RootPage' ;
@@ -184,15 +173,6 @@ class IDEView extends React.Component {
184
173
key = { this . props . project . id }
185
174
/>
186
175
</ CmControllerContext . Provider >
187
- { this . props . ide . preferencesIsVisible && (
188
- < Overlay
189
- title = { this . props . t ( 'Preferences.Settings' ) }
190
- ariaLabel = { this . props . t ( 'Preferences.Settings' ) }
191
- closeOverlay = { this . props . closePreferences }
192
- >
193
- < Preferences />
194
- </ Overlay >
195
- ) }
196
176
< main className = "editor-preview-container" >
197
177
< SplitPane
198
178
split = "vertical"
@@ -262,76 +242,7 @@ class IDEView extends React.Component {
262
242
</ SplitPane >
263
243
</ SplitPane >
264
244
</ main >
265
- { this . props . ide . modalIsVisible && < NewFileModal /> }
266
- { this . props . ide . newFolderModalVisible && < NewFolderModal /> }
267
- { this . props . ide . uploadFileModalVisible && < UploadFileModal /> }
268
- { this . props . location . pathname === '/about' && (
269
- < Overlay
270
- title = { this . props . t ( 'About.Title' ) }
271
- previousPath = { this . props . ide . previousPath }
272
- ariaLabel = { this . props . t ( 'About.Title' ) }
273
- >
274
- < About previousPath = { this . props . ide . previousPath } />
275
- </ Overlay >
276
- ) }
277
- { this . props . location . pathname === '/feedback' && (
278
- < Overlay
279
- title = { this . props . t ( 'IDEView.SubmitFeedback' ) }
280
- previousPath = { this . props . ide . previousPath }
281
- ariaLabel = { this . props . t ( 'IDEView.SubmitFeedbackARIA' ) }
282
- >
283
- < Feedback />
284
- </ Overlay >
285
- ) }
286
- { this . props . location . pathname . match ( / a d d - t o - c o l l e c t i o n $ / ) && (
287
- < Overlay
288
- ariaLabel = { this . props . t ( 'IDEView.AddCollectionARIA' ) }
289
- title = { this . props . t ( 'IDEView.AddCollectionTitle' ) }
290
- previousPath = { this . props . ide . previousPath }
291
- actions = { < CollectionSearchbar /> }
292
- isFixedHeight
293
- >
294
- < AddToCollectionList
295
- projectId = { this . props . params . project_id }
296
- username = { this . props . params . username }
297
- user = { this . props . user }
298
- />
299
- </ Overlay >
300
- ) }
301
- { this . props . ide . shareModalVisible && (
302
- < Overlay
303
- title = { this . props . t ( 'IDEView.ShareTitle' ) }
304
- ariaLabel = { this . props . t ( 'IDEView.ShareARIA' ) }
305
- closeOverlay = { this . props . closeShareModal }
306
- >
307
- < ShareModal
308
- projectId = { this . props . ide . shareModalProjectId }
309
- projectName = { this . props . ide . shareModalProjectName }
310
- ownerUsername = { this . props . ide . shareModalProjectUsername }
311
- />
312
- </ Overlay >
313
- ) }
314
- { this . props . ide . keyboardShortcutVisible && (
315
- < Overlay
316
- title = { this . props . t ( 'KeyboardShortcuts.Title' ) }
317
- ariaLabel = { this . props . t ( 'KeyboardShortcuts.Title' ) }
318
- closeOverlay = { this . props . closeKeyboardShortcutModal }
319
- >
320
- < KeyboardShortcutModal />
321
- </ Overlay >
322
- ) }
323
- { this . props . ide . errorType && (
324
- < Overlay
325
- title = { this . props . t ( 'Common.Error' ) }
326
- ariaLabel = { this . props . t ( 'Common.ErrorARIA' ) }
327
- closeOverlay = { this . props . hideErrorModal }
328
- >
329
- < ErrorModal
330
- type = { this . props . ide . errorType }
331
- closeModal = { this . props . hideErrorModal }
332
- />
333
- </ Overlay >
334
- ) }
245
+ < IDEOverlays />
335
246
</ RootPage >
336
247
) ;
337
248
}
@@ -397,7 +308,6 @@ IDEView.propTypes = {
397
308
autocloseBracketsQuotes : PropTypes . bool . isRequired ,
398
309
autocompleteHinter : PropTypes . bool . isRequired
399
310
} ) . isRequired ,
400
- closePreferences : PropTypes . func . isRequired ,
401
311
selectedFile : PropTypes . shape ( {
402
312
id : PropTypes . string . isRequired ,
403
313
content : PropTypes . string . isRequired ,
@@ -409,11 +319,8 @@ IDEView.propTypes = {
409
319
content : PropTypes . string . isRequired
410
320
} ) . isRequired ,
411
321
updateFileContent : PropTypes . func . isRequired ,
412
- closeShareModal : PropTypes . func . isRequired ,
413
- closeKeyboardShortcutModal : PropTypes . func . isRequired ,
414
322
autosaveProject : PropTypes . func . isRequired ,
415
323
setPreviousPath : PropTypes . func . isRequired ,
416
- hideErrorModal : PropTypes . func . isRequired ,
417
324
clearPersistedState : PropTypes . func . isRequired ,
418
325
t : PropTypes . func . isRequired ,
419
326
isUserOwner : PropTypes . bool . isRequired
0 commit comments