From f7e564fb114946101394ac1a666f28fc17188620 Mon Sep 17 00:00:00 2001 From: lluiscab Date: Sun, 30 Jul 2017 15:42:23 +0200 Subject: [PATCH 1/3] Added hideNavigation boolean to hide next / prev / last / first arrows --- src/components/Pagination.js | 14 ++++++++------ src/example/App.js | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 6 deletions(-) diff --git a/src/components/Pagination.js b/src/components/Pagination.js index b33b271..9b04ae2 100644 --- a/src/components/Pagination.js +++ b/src/components/Pagination.js @@ -31,7 +31,8 @@ export default class Pagination extends React.Component { linkClass: PropTypes.string, activeClass: PropTypes.string, disabledClass: PropTypes.string, - hideDisabled: PropTypes.bool + hideDisabled: PropTypes.bool, + hideNavigation: PropTypes.bool } static defaultProps = { @@ -63,7 +64,8 @@ export default class Pagination extends React.Component { itemClass, linkClass, disabledClass, - hideDisabled + hideDisabled, + hideNavigation } = this.props; const paginationInfo = new paginator(itemsCountPerPage, pageRangeDisplayed) @@ -86,7 +88,7 @@ export default class Pagination extends React.Component { } } - (hideDisabled && !paginationInfo.has_previous_page) || pages.unshift( + ((hideDisabled && !paginationInfo.has_previous_page) || hideNavigation) || pages.unshift( ); - (hideDisabled && !paginationInfo.has_previous_page) || pages.unshift( + ((hideDisabled && !paginationInfo.has_previous_page) || hideNavigation) || pages.unshift( ); - (hideDisabled && !paginationInfo.has_next_page) || pages.push( + ((hideDisabled && !paginationInfo.has_next_page) || hideNavigation) || pages.push( ); - (hideDisabled && !paginationInfo.has_next_page) || pages.push( + ((hideDisabled && !paginationInfo.has_next_page) || hideNavigation) || pages.push( ); }`; + + const hideNavigation = `render() { + return ( + + ); +}`; + const overrideText = `render() { return ( + +
+ +
+ {hideNavigation} +
+ +
+
+
+ ); } From 0fefed7b9964057c6ef3b72f9dde699aa635827f Mon Sep 17 00:00:00 2001 From: lluiscab Date: Sun, 30 Jul 2017 15:48:51 +0200 Subject: [PATCH 2/3] Added activeLinkClass --- README.md | 2 ++ src/components/Page.js | 7 ++++++- src/components/Pagination.js | 4 ++++ src/example/App.js | 21 +++++++++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 57fb21a..85ff5b7 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,9 @@ Name | Type | Default | Description `nextPageText` | String / ReactElement | `⟩` | Text of next page navigation button `innerClass` | String | `pagination` | Class name of `