Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created Mar 20, 2016
Embed
What would you like to do?
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