import React, { Component } from 'react' import PropTypes from 'prop-types' import { Spinner, Header, Navbar } from '.' import '../stylesheets/globals.scss' import contentStyle from '../stylesheets/content.scss' import styles from './Post.scss' import MarkdownIt from 'markdown-it' import fm from 'front-matter' import moment from 'moment' export default class Post extends Component { static propTypes = { isLoading: PropTypes.bool.isRequired, post: PropTypes.object.isRequired } render () { const md = MarkdownIt() const content = fm(this.props.post) const title = content.attributes.title const date = moment(content.attributes.date, 'YYYY-MM-DD') const body = md.render(content.body) if (this.props.isLoading) { return (