1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-11 18:32:50 +00:00
This commit is contained in:
2016-09-27 23:34:30 +00:00
parent 0575487ac4
commit 90b4570d01
8 changed files with 62 additions and 89 deletions

View File

@@ -36,19 +36,21 @@ export default class Preview extends React.Component {
render() {
const posts = this.props.app.preview.posts;
const postLimit = this.props.app.postLimit;
const fetched = this.props.app.fetched;
let fetched = this.props.app.fetched;
const increasePostLimit = this.props.appActions.increasePostLimit;
if (!fetched){
return <Loading/>;
}
return (
<div class="Content">
{fetched ?
<div>
{posts.length > 0 ? this.insertPosts(posts): null}
{posts.length > postLimit ?
<button class="btn" onClick={increasePostLimit}>Load More</button>
: null}
</div>
: <Loading/>}
</div>
);
}