-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
91 lines (85 loc) · 2.02 KB
/
app.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
import React from 'react';
import ReactDOM from 'react-dom';
const arrOfTweets = [
{
"author": "Michael Scott",
"text": "Would I rather be feared or loved? Easy, both. I want people to be afraid of how much they love me."
},
{
"author": "Jeff Bezos",
"text": "In the end, we are our choices."
}
];
class Twitter extends React.Component {
constructor(props) {
super(props);
// this.state = {};
// this.loadTweetsFromServer = this.loadTweetsFromServer.bind(this);
// this.handleTweetSubmit = this.handleTweetSubmit.bind(this);
}
// loadTweetsFromServer() {
// // GET updated set of tweets from database
// $.get(this.props.url, (data) => {
// // Set state in step 6 of the exercise!
// }
// );
// }
// handleTweetSubmit(author, text) {
// const tweet = { author, text };
//
// // POST to add tweet to database
// $.post(this.props.url, tweet, (data) => {
// // Set state in step 10 of the exercise!
// }
// );
// }
// componentDidMount() {
// // Set this.state.data to most recent set of tweets from database
// this.loadTweetsFromServer();
// }
render() {
return (
<div className="twitter">
<h1>Tweets</h1>
{/* Render TweetForm component here */}
{/* Render TweetList component here */}
</div>
);
}
}
class TweetForm extends React.Component {
constructor(props) {
super(props);
// this.handleSubmit = this.handleSubmit.bind(this);
}
// handleSubmit(e) {}
render() {
return (
<form className="tweetForm">
{/* Render some text here */}
</form>
);
}
}
class TweetList extends React.Component {
render() {
return (
<div className="tweetList">
{/* Render some text here */}
</div>
);
}
}
class Tweet extends React.Component {
render() {
return (
<div className="tweet">
{/* Render some text here */}
</div>
);
}
}
ReactDOM.render(
<Twitter />,
document.getElementById('tweets')
);