Created
March 20, 2016 20:59
-
-
Save chuck0523/c31f8f9ab4c8e29787e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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