diff --git a/src/components/Post.js b/src/components/Post.js index 5071742..e2c888e 100644 --- a/src/components/Post.js +++ b/src/components/Post.js @@ -5,23 +5,37 @@ import { fetchPost } from '../actions'; import { Link } from 'react-router-dom'; class Post extends React.Component { + constructor (props) { + super(props) + this.state = { + isLoading: true + } + } componentDidMount() { const { slug } = this.props.match.params - this.props.fetchPost(slug); + this.props.fetchPost(slug) + .then(() => this.setState({isLoading: false})) } render () { - console.log(this.props.posts) - return ( -
Loading
+ } else { + const post = posts.entities[posts.currentId] + return ( +