1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-11 18:32:50 +00:00

added check fetching functionality

This commit is contained in:
2016-08-27 07:30:32 +00:00
parent 4bcb240e97
commit d173b06129
6 changed files with 33 additions and 8 deletions

View File

@@ -33,12 +33,16 @@ export default class Index extends React.Component {
}
render() {
const fetched = this.props.redux.fetched;
const fetching = this.props.redux.fetching;
return (
<div>
<Header />
<div class="Main">
{typeof this.page === 'undefined' ? <Preview posts={this.props.redux.preview.posts} /> : ""}
{this.page === 'post' ? <Post content={this.props.redux.post}/> : ""}
{typeof this.page === 'undefined' && !fetching ? <Preview posts={this.props.redux.preview.posts} /> : null}
{this.page === 'post' && !fetching ? <Post content={this.props.redux.post}/> : null}
{fetching ? <div class="Content">Fetching</div> : null}
<Sidebar />
</div>
<Footer />