rickvanlieshout.com/components/SitePage/index.jsx
Axel Clark eb9274ae92 Update required prop for SitePost and Site Page
* Changed required prop from post to route
* Removed propType for pages
* These are objects on route prop and not passed in individually
* Closes #25
2016-12-10 15:18:43 -05:00

40 lines
1.1 KiB
JavaScript

import React from 'react'
import moment from 'moment'
import { RouteHandler, Link } from 'react-router'
import { prefixLink } from 'gatsby-helpers'
import access from 'safe-access'
import { config } from 'config'
import SiteSidebar from '../SiteSidebar'
import './style.css';
class SitePage extends React.Component {
render() {
const {route} = this.props
const post = route.page.data
return (
<div>
<SiteSidebar {...this.props}/>
<div className='content'>
<div className='main'>
<div className='main-inner'>
<div className='blog-page'>
<div className='text'>
<h1>{ post.title }</h1>
<div dangerouslySetInnerHTML={ { __html: post.body} } />
</div>
</div>
</div>
</div>
</div>
</div>
);
}
}
SitePage.propTypes = {
route: React.PropTypes.object.isRequired,
}
export default SitePage