import React from 'react'; import {Link} from 'react-router'; //components import Loading from './utils/Loading'; import '../../assets/scss/Content.scss'; export default class Preview extends React.Component { componentDidMount() { this.props.appActions.fetchPreview(); } insertPosts(posts) { let elements = []; for (let i = 0; i < this.props.app.postLimit && i < posts.length; i++) { elements.push(
{posts[i].date}

continue reading

); } return elements; } render() { const posts = this.props.app.preview.posts; const postLimit = this.props.app.postLimit; const fetched = this.props.app.fetched; const increasePostLimit = this.props.appActions.increasePostLimit; return (
{fetched ?
{posts.length > 0 ? this.insertPosts(posts): null} {posts.length > postLimit ? : null}
: }
); } }