Skip to content

Commit

Permalink
Merge 15a10ec into 848c079
Browse files Browse the repository at this point in the history
  • Loading branch information
victorhmp committed Aug 27, 2019
2 parents 848c079 + 15a10ec commit 8def541
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- `itemPerPage` would not be taken into consideration if its value was greater than 5, as this limit was set in the `ShelfContent` component.

## [1.28.0] - 2019-08-16
### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ For `RelatedProducts`:
| `summary` | `Object` | Product Summary schema properties. | - |
| `gap` | `Enum` | Gap between items. Possible values: `ph0`, `ph3`,`ph5`, `ph7`. | `ph3` |
| `minItemsPerPage` | `Number` | Minimum amount of slides to be on the screen, can be used to control how many itens will be displayed in the smallest screen size. This value can be a **Float**, which should be a multiple of 0.5 and would indicate that you want to show a "peek" of the next item in the Shelf. | `1` |
| `itemsPerPage` | `Number` | Maximum amount of slides to be on the screen. Can be used to control how many items will be displayed in the biggest screen size. This value needs to be an **Integer**. | `5` |
| `itemsPerPage` | `Number` | Maximum amount of slides to be on the screen. Can be used to control how many items will be displayed in the biggest screen size. This value can be a **Float**, which should be a multiple of 0.5 and would indicate that you want to show a "peek" of the next item in the Shelf. | `5` |

For `TabbedShelf`:

Expand Down
4 changes: 3 additions & 1 deletion react/components/ShelfContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class ShelfContent extends Component {
gap,
arrows,
summary,
itemsPerPage,
minItemsPerPage,
paginationDotsVisibility,
isMobile,
Expand All @@ -103,13 +104,14 @@ class ShelfContent extends Component {
!products || !products.length ? Array(maxItems).fill(null) : products

const roundedMinItems = this.roundHalf(minItemsPerPage)
const customPerPage = !isMobile && itemsPerPage

return (
<div className="flex justify-center">
<SliderContainer className="w-100 mw9">
<Slider
minPerPage={roundedMinItems}
perPage={this.perPage}
perPage={customPerPage || this.perPage}
onChangeSlide={this.handleChangeSlide}
currentSlide={Math.ceil(currentSlide)}
arrowRender={arrows && this.arrowRender}
Expand Down

0 comments on commit 8def541

Please sign in to comment.