Update Blog props
This commit is contained in:
parent
bc01f94f6e
commit
4048fbbc66
|
@ -3,19 +3,27 @@ import React, {Component} from 'react';
|
|||
export default class Blog extends Component {
|
||||
|
||||
render() {
|
||||
if (this.props.data.isLoading) {
|
||||
if (this.props.isLoading) {
|
||||
return (
|
||||
<h1>Loading</h1>
|
||||
);
|
||||
}
|
||||
|
||||
let posts = this.props.posts.map((post) => {
|
||||
return (
|
||||
<div>
|
||||
<div>{post.published}</div>
|
||||
<div>{post.filename}</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="content">
|
||||
<h1>Blog</h1>
|
||||
|
||||
<div>{this.props.data.posts[0].published}</div>
|
||||
<div>{this.props.data.posts[0].filename}</div>
|
||||
{posts}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -23,7 +23,8 @@ export default class BlogContainer extends Component {
|
|||
|
||||
render() {
|
||||
return (
|
||||
<Blog data={this.state}/>
|
||||
<Blog isLoading={this.state.isLoading}
|
||||
posts={this.state.posts}/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue