Skip to content

Commit

Permalink
feat(carousel): include itemsPerPage meta data in render prop args
Browse files Browse the repository at this point in the history
  • Loading branch information
danethurber committed Aug 15, 2019
1 parent 124e5a1 commit 77c9b1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Expand Up @@ -182,6 +182,7 @@ exports[`Storyshots Carousel/Item with render props 1`] = `
{
"isActivePage": true,
"itemIndex": 0,
"itemsPerPage": 1,
"pageCount": 9,
"pageIndex": 0
}
Expand Down
3 changes: 3 additions & 0 deletions packages/carousel/src/react/index.js
Expand Up @@ -94,6 +94,7 @@ export default function Carousel({ controls, size, ...props }) {

isActivePage,
itemIndex,
itemsPerPage: perPage,
pageCount,
pageIndex
})
Expand All @@ -118,6 +119,7 @@ function Item({ children, ...props }) {
? children({
isActivePage: props.isActivePage,
itemIndex: props.itemIndex,
itemsPerPage: props.itemsPerPage,
pageCount: props.pageCount,
pageIndex: props.pageIndex
})
Expand All @@ -130,6 +132,7 @@ Item.propTypes = {
children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
isActivePage: PropTypes.bool,
itemIndex: PropTypes.number,
itemsPerPage: PropTypes.number,
pageCount: PropTypes.number,
pageIndex: PropTypes.number
}
Expand Down

0 comments on commit 77c9b1c

Please sign in to comment.