UNPKG

phenomic

Version:

Modern website generator based on the React and Webpack ecosystem.

39 lines (32 loc) 787 B
import React, { PropTypes } from "react" import LatestPosts from "../../components/LatestPosts" import Page from "../Page" import styles from "./index.css" const Post = (props) => { // it's up to you to choose what to do with this layout ;) const pageDate = props.head.date ? new Date(props.head.date) : null return ( <Page { ...props } header={ <div> <header className={ styles.header }> { pageDate && <time key={ pageDate.toISOString() }> { pageDate.toDateString() } </time> } </header> </div> } > <hr /> <LatestPosts /> </Page> ) } Post.propTypes = { head: PropTypes.object.isRequired, } export default Post