diff --git a/client/src/templates/Challenges/classic/Editor.js b/client/src/templates/Challenges/classic/Editor.js index d88c9a6f44..29474b0887 100644 --- a/client/src/templates/Challenges/classic/Editor.js +++ b/client/src/templates/Challenges/classic/Editor.js @@ -298,7 +298,7 @@ class Editor extends Component { } render() { - const { theme } = this.props; + const { challengeFiles, theme } = this.props; const editorTheme = theme === 'night' ? 'vs-dark-custom' : 'vs-custom'; // TODO: tabs should be dynamically created from the challengeFiles @@ -307,24 +307,30 @@ class Editor extends Component { }>
-
this.changeTab('indexhtml')} - > - index.html -
-
this.changeTab('indexjs')} - > - script.js -
-
this.changeTab('indexcss')} - > - styles.css -
+ {challengeFiles['indexhtml'] && ( +
this.changeTab('indexhtml')} + > + index.html +
+ )} + {challengeFiles['indexjs'] && ( +
this.changeTab('indexjs')} + > + script.js +
+ )} + {challengeFiles['indexcss'] && ( +
this.changeTab('indexcss')} + > + styles.css +
+ )}