+ {challengeFiles['indexjsx'] && (
+
this.changeTab('indexjsx')}
+ >
+ script.jsx
+
+ )}
{challengeFiles['indexhtml'] && (
{
if (a.ext === 'html') return -1;
if (b.ext === 'html') return 1;
+ if (a.ext === 'jsx') return -1;
+ if (b.ext === 'jsx') return 1;
if (a.ext === 'js') return -1;
if (b.ext === 'js') return 1;
return 0;
diff --git a/client/src/templates/Challenges/utils/sort-files.test.js b/client/src/templates/Challenges/utils/sort-files.test.js
index 7a3175a235..5fe0c8cbc4 100644
--- a/client/src/templates/Challenges/utils/sort-files.test.js
+++ b/client/src/templates/Challenges/utils/sort-files.test.js
@@ -19,8 +19,9 @@ describe('sort-files', () => {
it('should sort the objects into html, js, css order', () => {
const sorted = sortFiles(challengeFiles);
const sortedKeys = sorted.map(({ key }) => key);
- const expected = ['indexhtml', 'indexjs', 'indexcss'];
+ const expected = ['indexhtml', 'indexjsx', 'indexjs', 'indexcss'];
expect(sortedKeys).toStrictEqual(expected);
});
+
});
});