@@ -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 Sidebar from '../components/Sidebar' ;
11
12
import PreviewFrame from '../components/PreviewFrame' ;
12
13
import Toolbar from '../components/Header/Toolbar' ;
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 Nav from '../components/Header/Nav' ;
21
15
import Console from '../components/Console' ;
22
16
import Toast from '../components/Toast' ;
@@ -28,11 +22,6 @@ import * as PreferencesActions from '../actions/preferences';
28
22
import * as UserActions from '../../User/actions' ;
29
23
import * as ConsoleActions from '../actions/console' ;
30
24
import { getHTMLFile } from '../reducers/files' ;
31
- import Overlay from '../../App/components/Overlay' ;
32
- import About from '../components/About' ;
33
- import AddToCollectionList from '../components/AddToCollectionList' ;
34
- import Feedback from '../components/Feedback' ;
35
- import { CollectionSearchbar } from '../components/Searchbar' ;
36
25
import { getIsUserOwner } from '../selectors/users' ;
37
26
import RootPage from '../../../components/RootPage' ;
38
27
@@ -266,15 +255,6 @@ class IDEView extends React.Component {
266
255
syncFileContent = { this . syncFileContent }
267
256
key = { this . props . project . id }
268
257
/>
269
- { this . props . ide . preferencesIsVisible && (
270
- < Overlay
271
- title = { this . props . t ( 'Preferences.Settings' ) }
272
- ariaLabel = { this . props . t ( 'Preferences.Settings' ) }
273
- closeOverlay = { this . props . closePreferences }
274
- >
275
- < Preferences />
276
- </ Overlay >
277
- ) }
278
258
< main className = "editor-preview-container" >
279
259
< SplitPane
280
260
split = "vertical"
@@ -344,76 +324,7 @@ class IDEView extends React.Component {
344
324
</ SplitPane >
345
325
</ SplitPane >
346
326
</ main >
347
- { this . props . ide . modalIsVisible && < NewFileModal /> }
348
- { this . props . ide . newFolderModalVisible && < NewFolderModal /> }
349
- { this . props . ide . uploadFileModalVisible && < UploadFileModal /> }
350
- { this . props . location . pathname === '/about' && (
351
- < Overlay
352
- title = { this . props . t ( 'About.Title' ) }
353
- previousPath = { this . props . ide . previousPath }
354
- ariaLabel = { this . props . t ( 'About.Title' ) }
355
- >
356
- < About previousPath = { this . props . ide . previousPath } />
357
- </ Overlay >
358
- ) }
359
- { this . props . location . pathname === '/feedback' && (
360
- < Overlay
361
- title = { this . props . t ( 'IDEView.SubmitFeedback' ) }
362
- previousPath = { this . props . ide . previousPath }
363
- ariaLabel = { this . props . t ( 'IDEView.SubmitFeedbackARIA' ) }
364
- >
365
- < Feedback />
366
- </ Overlay >
367
- ) }
368
- { this . props . location . pathname . match ( / a d d - t o - c o l l e c t i o n $ / ) && (
369
- < Overlay
370
- ariaLabel = { this . props . t ( 'IDEView.AddCollectionARIA' ) }
371
- title = { this . props . t ( 'IDEView.AddCollectionTitle' ) }
372
- previousPath = { this . props . ide . previousPath }
373
- actions = { < CollectionSearchbar /> }
374
- isFixedHeight
375
- >
376
- < AddToCollectionList
377
- projectId = { this . props . params . project_id }
378
- username = { this . props . params . username }
379
- user = { this . props . user }
380
- />
381
- </ Overlay >
382
- ) }
383
- { this . props . ide . shareModalVisible && (
384
- < Overlay
385
- title = { this . props . t ( 'IDEView.ShareTitle' ) }
386
- ariaLabel = { this . props . t ( 'IDEView.ShareARIA' ) }
387
- closeOverlay = { this . props . closeShareModal }
388
- >
389
- < ShareModal
390
- projectId = { this . props . ide . shareModalProjectId }
391
- projectName = { this . props . ide . shareModalProjectName }
392
- ownerUsername = { this . props . ide . shareModalProjectUsername }
393
- />
394
- </ Overlay >
395
- ) }
396
- { this . props . ide . keyboardShortcutVisible && (
397
- < Overlay
398
- title = { this . props . t ( 'KeyboardShortcuts.Title' ) }
399
- ariaLabel = { this . props . t ( 'KeyboardShortcuts.Title' ) }
400
- closeOverlay = { this . props . closeKeyboardShortcutModal }
401
- >
402
- < KeyboardShortcutModal />
403
- </ Overlay >
404
- ) }
405
- { this . props . ide . errorType && (
406
- < Overlay
407
- title = { this . props . t ( 'Common.Error' ) }
408
- ariaLabel = { this . props . t ( 'Common.ErrorARIA' ) }
409
- closeOverlay = { this . props . hideErrorModal }
410
- >
411
- < ErrorModal
412
- type = { this . props . ide . errorType }
413
- closeModal = { this . props . hideErrorModal }
414
- />
415
- </ Overlay >
416
- ) }
327
+ < IDEOverlays />
417
328
</ RootPage >
418
329
) ;
419
330
}
@@ -480,7 +391,6 @@ IDEView.propTypes = {
480
391
autocloseBracketsQuotes : PropTypes . bool . isRequired ,
481
392
autocompleteHinter : PropTypes . bool . isRequired
482
393
} ) . isRequired ,
483
- closePreferences : PropTypes . func . isRequired ,
484
394
setAllAccessibleOutput : PropTypes . func . isRequired ,
485
395
selectedFile : PropTypes . shape ( {
486
396
id : PropTypes . string . isRequired ,
@@ -500,12 +410,9 @@ IDEView.propTypes = {
500
410
updateFileContent : PropTypes . func . isRequired ,
501
411
closeNewFolderModal : PropTypes . func . isRequired ,
502
412
closeNewFileModal : PropTypes . func . isRequired ,
503
- closeShareModal : PropTypes . func . isRequired ,
504
- closeKeyboardShortcutModal : PropTypes . func . isRequired ,
505
413
autosaveProject : PropTypes . func . isRequired ,
506
414
setPreviousPath : PropTypes . func . isRequired ,
507
415
showErrorModal : PropTypes . func . isRequired ,
508
- hideErrorModal : PropTypes . func . isRequired ,
509
416
clearPersistedState : PropTypes . func . isRequired ,
510
417
startSketch : PropTypes . func . isRequired ,
511
418
closeUploadFileModal : PropTypes . func . isRequired ,
0 commit comments