Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created March 20, 2016 20:59
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/c31f8f9ab4c8e29787e3 to your computer and use it in GitHub Desktop.
Save chuck0523/c31f8f9ab4c8e29787e3 to your computer and use it in GitHub Desktop.
import React, { PropTypes } from 'react'
import Page from './Page'
import Data from '../data/slide'
import Style from '../styles/slide'
const Slide = ({currentPage, onPrevClick, onNextClick}) => (
<div className={"slide"}>
<div
onClick={(currentPage) => onPrevClick(currentPage)}>
prev
</div>
{Data.map((page, index) =>
<Page
key={index+1}
page={page}
currentPage={currentPage}
index={index}
/>
)}
<div
onClick={(currentPage) => onNextClick(currentPage)}>
next
</div>
</div>
)
Slide.propTypes = {
currentPage: PropTypes.number.isRequired,
onPrevClick: PropTypes.func.isRequired,
onNextClick: PropTypes.func.isRequired
}
export default Slide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment