Trump stream
This commit is contained in:
parent
3235956181
commit
fb4fa3cecb
5 changed files with 96 additions and 23 deletions
|
@ -4,7 +4,7 @@ import { getHillaryData } from "../actions/index"
|
|||
import { getTrumpData } from "../actions/index"
|
||||
|
||||
export function Post(props) {
|
||||
let { articles, articlesHillary, candidate, getHillaryData, getTrumpData } = props
|
||||
let { articles, articlesTrump, articlesHillary, candidate, getHillaryData, getTrumpData } = props
|
||||
|
||||
// Fetch tweets when user clicks on candidate's button
|
||||
useEffect(() => {
|
||||
|
@ -39,6 +39,16 @@ export function Post(props) {
|
|||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<p>Trump stream</p>
|
||||
<ul className="list-group list-group-flush">
|
||||
{articlesTrump.map(el => (
|
||||
<li className="list-group-item" key={el.id_str}>
|
||||
<p>{el.created_at}</p>
|
||||
<p>{el.text}</p>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -47,6 +57,7 @@ function mapStateToProps(state) {
|
|||
return {
|
||||
articles: state.remoteArticles.slice(0, 10),
|
||||
articlesHillary: state.remoteArticlesHillary.slice(0, 10),
|
||||
articlesTrump: state.remoteArticlesTrump.slice(0, 10),
|
||||
candidate: state.candidate
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue