File tree Expand file tree Collapse file tree 4 files changed +87
-10
lines changed
client/src/templates/Challenges
_meta/front-end-development-libraries-projects
english/03-front-end-development-libraries/front-end-development-libraries-projects Expand file tree Collapse file tree 4 files changed +87
-10
lines changed Original file line number Diff line number Diff line change @@ -220,13 +220,24 @@ export const embedFilesInHtml = async function (challengeFiles) {
220
220
const style = contentDocument . createElement ( 'style' ) ;
221
221
style . classList . add ( 'fcc-injected-styles' ) ;
222
222
style . innerHTML = stylesCss ?. contents ;
223
-
224
223
link . parentNode . replaceChild ( style , link ) ;
224
+ } else if ( stylesCss ?. contents ) {
225
+ // automatic linking of style contents to html
226
+ const style = contentDocument . createElement ( 'style' ) ;
227
+ style . classList . add ( 'fcc-injected-styles' ) ;
228
+ style . innerHTML = stylesCss ?. contents ;
229
+ contentDocument . head . appendChild ( style ) ;
225
230
}
226
231
if ( script ) {
227
- const script = ( contentDocument . createElement ( 'script' ) . innerHTML =
228
- scriptJs ?. contents ) ;
229
- link . parentNode . replaceChild ( script , link ) ;
232
+ const newScript = contentDocument . createElement ( 'script' ) ;
233
+ newScript . innerHTML = scriptJs ?. contents ;
234
+ script . parentNode . replaceChild ( newScript , script ) ;
235
+ }
236
+ if ( indexJsx ?. contents ) {
237
+ // automatic linking of jsx to html
238
+ const newScript = contentDocument . createElement ( 'script' ) ;
239
+ newScript . innerHTML = indexJsx ?. contents ;
240
+ contentDocument . head . appendChild ( newScript ) ;
230
241
}
231
242
return {
232
243
contents : documentElement . innerHTML
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ function* buildChallengeData(challengeData, options) {
175
175
}
176
176
}
177
177
178
- function * executeTests ( testRunner , tests , testTimeout = 5000 ) {
178
+ function * executeTests ( testRunner , tests , testTimeout = 70000 ) {
179
179
const testResults = [ ] ;
180
180
for ( let i = 0 ; i < tests . length ; i ++ ) {
181
181
const { text, testString } = tests [ i ] ;
Original file line number Diff line number Diff line change 4
4
"dashedName" : " front-end-development-libraries-projects" ,
5
5
"order" : 6 ,
6
6
"time" : " 150 hours" ,
7
- "template" : " " ,
8
- "required" : [],
7
+ "template" : " <body><div id='root'></div>${ source || '' }</body>" ,
8
+ "required" : [
9
+ {
10
+ "link" : " https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css"
11
+ },
12
+ {
13
+ "src" : " https://code.jquery.com/jquery-3.6.0.min.js"
14
+ },
15
+ {
16
+ "src" : " https://unpkg.com/react@16.4.0/umd/react.production.min.js"
17
+ },
18
+ {
19
+ "src" : " https://unpkg.com/react-dom@16.4.0/umd/react-dom.production.min.js"
20
+ },
21
+ {
22
+ "src" : " https://cdnjs.cloudflare.com/ajax/libs/redux/3.7.2/redux.min.js"
23
+ },
24
+ {
25
+ "src" : " https://cdnjs.cloudflare.com/ajax/libs/react-redux/5.0.7/react-redux.min.js"
26
+ }
27
+ ],
9
28
"superBlock" : " front-end-development-libraries" ,
10
29
"challengeOrder" : [
11
30
[
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ dashedName: build-a-25--5-clock
8
8
9
9
# --description--
10
10
11
- ** Objective:** Build a [ CodePen.io ] ( https://codepen.io ) app that is functionally similar to this: < https://codepen.io/freeCodeCamp/full/XpKrrW > .
11
+ ** Objective:** Build an app that is functionally similar to this: < https://codepen.io/freeCodeCamp/full/XpKrrW > .
12
12
13
13
Fulfill the below [ user stories] ( https://en.wikipedia.org/wiki/User_story ) and get all of the tests to pass. Give it your own personal style.
14
14
@@ -1210,18 +1210,65 @@ assert.strictEqual(
1210
1210
1211
1211
# --seed--
1212
1212
1213
+ ## --after-user-code--
1214
+
1215
+ ``` jsx
1216
+ ReactDOM .render (< App / > , document .getElementById (' root' ))
1217
+ ```
1218
+
1213
1219
## --seed-contents--
1214
1220
1215
1221
``` html
1216
-
1222
+ <!DOCTYPE html>
1223
+ <html >
1224
+ <body >
1225
+ <!-- Change code below this line-->
1226
+ <p >Hello from HTML!</p >
1227
+ <!-- Change code above this line-->
1228
+ </body >
1229
+ </html >
1217
1230
```
1218
1231
1219
1232
``` css
1220
1233
1221
1234
```
1222
1235
1236
+ ``` jsx
1237
+ class App extends React .Component {
1238
+ constructor (props ) {
1239
+ super (props);
1240
+ }
1241
+
1242
+ render () {
1243
+ return (
1244
+ < div>
1245
+ { /* Change code below this line */ }
1246
+ < Timer / >
1247
+ { /* Change code above this line */ }
1248
+ < / div>
1249
+ );
1250
+ }
1251
+ };
1252
+
1253
+ class Timer extends React .Component {
1254
+ constructor (props ) {
1255
+ super (props);
1256
+
1257
+ }
1258
+ render () {
1259
+ return (
1260
+ < div>
1261
+ { /* Change code below this line */ }
1262
+ < p> Hello from JSX ! < / p>
1263
+ { /* Change code above this line */ }
1264
+ < / div>
1265
+ );
1266
+ }
1267
+ };
1268
+ ```
1269
+
1223
1270
# --solutions--
1224
1271
1225
- ``` js
1272
+ ``` jsx
1226
1273
// solution required
1227
1274
```
You can’t perform that action at this time.
0 commit comments