Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created March 20, 2016 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuck0523/0237a788ddca1665e881 to your computer and use it in GitHub Desktop.
Save chuck0523/0237a788ddca1665e881 to your computer and use it in GitHub Desktop.
import React, { PropTypes } from 'react'
import Style from '../styles/page'
const Page = ({currentPage, index, page}) => (
<div
className={"page"}
style={{display: currentPage === index ? 'block' : 'none'}}
>
<div className={"title"}>
{page.title}
</div>
<div className={"body"}>
{page.body}
</div>
</div>
)
Page.propTypes = {
currentPage: PropTypes.number.isRequired,
index: PropTypes.number.isRequired
}
export default Page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment