Skip to content

Commit

Permalink
fix: pagination padding (#2866)
Browse files Browse the repository at this point in the history
* feat(stories): add pagination with padding
* refactor(pagination): remove default value from widget
* fix(pagination): provide padding to the connector
  • Loading branch information
samouss authored and bobylito committed Apr 6, 2018
1 parent f5d1ab1 commit e8c58cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions dev/app/builtin/stories/pagination.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ export default () => {
);
})
)
.add(
'with padding',
wrapWithHits(container => {
window.search.addWidget(
instantsearch.widgets.pagination({
container,
padding: 6,
})
);
})
)
.add(
'without autoHideContainer',
wrapWithHits(container => {
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/pagination/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default function pagination({
labels: userLabels = defaultLabels,
cssClasses: userCssClasses = {},
maxPages,
padding = 3,
padding,
showFirstLast = true,
autoHideContainer = true,
scrollTo: userScrollTo = 'body',
Expand Down Expand Up @@ -189,7 +189,7 @@ export default function pagination({
const makeWidget = connectPagination(specializedRenderer, () =>
unmountComponentAtNode(containerNode)
);
return makeWidget({ maxPages });
return makeWidget({ maxPages, padding });
} catch (e) {
throw new Error(usage);
}
Expand Down

0 comments on commit e8c58cc

Please sign in to comment.