-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMac D.js
117 lines (102 loc) · 2.5 KB
/
Mac D.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import React from "react";
import ReactDom from "react-dom";
//CSS
import "./index.css";
// function Greeting() {
// return <h4>Hello James</h4>;
// }
//stateless functional component
//always return jsx
// const Greeting = () => {
// return (
// <div>
// <h1>Hello World </h1>
// </div>
// );
// };
// const Greeting = () => {
// return React.createElement("div", {}, React.createElement("h1", {}, "hello"));
// };
// const Greeting = () => {
// return (
// <React.Fragment>
// <section onClick={() => {alert("Hello")}}>
// <article className='hello'>
// <h1>Hello World</h1>
// <p>How do</p>
// </article>
// </section>
// </React.Fragment>
// );
// };
// function BookList() {
// return (
// <section className="Favorite">
// <Person />
// <Message />
// </section>
// );
// }
// const Person = () => <h4>Johnny</h4>;
// const Message = () => {
// <h2>Hello To You Sir</h2>;
// };
const firstBook = {
author: "Matt Haig",
title: "The Midnight Library: A Novel",
img: "https://www.easons.com/globalassets/5637150827/all/books/childrens/childrens-picture-bk/0-to-4-years/9781848690691.jpg",
};
const secondBook = {
author: "Don Miguel Ruiz",
author2: "Cormac",
title: "The Four Agreements: A Practical Guide",
img: "https://images-na.ssl-images-amazon.com/images/I/91p5b0UgbKL._AC_UL200_SR200,200_.jpg",
};
const imagine = {
author: "Cormac",
secondLog: "D",
};
function BookList() {
return (
<div>
<h1 className="text text-1">Amazon Best Seller</h1>
<section className="booklist">
<Book
title={firstBook.title}
img={firstBook.img}
author={firstBook.author}
/>
<Book
title={secondBook.title}
img={secondBook.img}
author={secondBook.author}
author2={secondBook.author2}
/>
<DanceOff
secondLog={imagine.secondLog}
author={imagine.author}
img={imagine.img}
/>
</section>
</div>
);
}
const Book = ({ img, author, author2, title }) => {
return (
<article className="book">
<img src={img}/>
<h1>{title} </h1>
<h4>{author} </h4>
<h4>{author2} </h4>
</article>
);
};
const DanceOff = ({ img, author, secondLog }) => {
return (
<article className="dance-off">
<h1>{author}</h1>
<h4>{secondLog} </h4>
</article>
);
};
ReactDom.render(<BookList />, document.getElementById("root"));