File tree Expand file tree Collapse file tree 4 files changed +41
-4
lines changed Expand file tree Collapse file tree 4 files changed +41
-4
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,19 @@ import React from "react";
2
2
import Header from "./Header" ;
3
3
import Footer from "./Footer" ;
4
4
import Note from "./Note" ;
5
+ import examples from "./examples" ;
5
6
6
7
function App ( ) {
7
8
return (
8
9
< div >
9
10
< Header />
10
- < Note />
11
+ { examples . map ( ( example ) => (
12
+ < Note
13
+ key = { example . key }
14
+ title = { example . title }
15
+ content = { example . content }
16
+ />
17
+ ) ) }
11
18
< Footer />
12
19
</ div >
13
20
) ;
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
2
3
- function Note ( ) {
3
+ function Note ( props ) {
4
4
return (
5
5
< div className = "note" >
6
- < h1 > Title </ h1 >
7
- < p > Content </ p >
6
+ < h1 > { props . title } </ h1 >
7
+ < p > { props . content } </ p >
8
8
</ div >
9
9
) ;
10
10
}
Original file line number Diff line number Diff line change
1
+ const examples = [
2
+ {
3
+ key : 1 ,
4
+ title : "Delegation" ,
5
+ content :
6
+ "Q. How many programmers does it take to change a light bulb? A. None – It’s a hardware problem"
7
+ } ,
8
+ {
9
+ key : 2 ,
10
+ title : "Loops" ,
11
+ content :
12
+ "How to keep a programmer in the shower forever. Show him the shampoo bottle instructions: Lather. Rinse. Repeat."
13
+ } ,
14
+ {
15
+ key : 3 ,
16
+ title : "Arrays" ,
17
+ content :
18
+ "Q. Why did the programmer quit his job? A. Because he didn't get arrays."
19
+ } ,
20
+ {
21
+ key : 4 ,
22
+ title : "Hardware vs. Software" ,
23
+ content :
24
+ "What's the difference between hardware and software? You can hit your hardware with a hammer, but you can only curse at your software."
25
+ }
26
+ ] ;
27
+
28
+ export default examples ;
Original file line number Diff line number Diff line change 11
11
12
12
//HINT: You will need to study the classes in teh styles.css file to appy styling.
13
13
14
+ //7. Add example notes
15
+
14
16
import React from "react" ;
15
17
import ReactDom from "react-dom" ;
16
18
import App from "./components/App" ;
You can’t perform that action at this time.
0 commit comments