From ad151b5ff003709f7fff0a282796b3ca66528837 Mon Sep 17 00:00:00 2001 From: Will Olson Date: Wed, 22 Nov 2017 09:17:21 -0800 Subject: [PATCH] refactor: Fix pagination.js linter errors --- src/pagination.js | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/pagination.js b/src/pagination.js index 496e81d..e5af788 100644 --- a/src/pagination.js +++ b/src/pagination.js @@ -4,7 +4,7 @@ import classnames from 'classnames' // import _ from './utils' const defaultButton = props => ( - ) @@ -42,7 +42,7 @@ export default class ReactTablePagination extends Component { } applyPage (e) { - e && e.preventDefault() + if (e) { e.preventDefault() } const page = this.state.page this.changePage(page === '' ? this.props.page : page) } @@ -70,9 +70,9 @@ export default class ReactTablePagination extends Component { className={classnames(className, '-pagination')} style={this.props.paginationStyle} > -
+
{ + onClick={() => { if (!canPrevious) return this.changePage(page - 1) }} @@ -81,11 +81,11 @@ export default class ReactTablePagination extends Component { {this.props.previousText}
-
- +
+ {this.props.pageText}{' '} {showPageJump - ?
+ ?
{ @@ -105,31 +105,30 @@ export default class ReactTablePagination extends Component { }} />
- : + : {page + 1} }{' '} {this.props.ofText}{' '} - {pages || 1} + {pages || 1} {showPageSizeOptions && - + }
-
+
{ + onClick={() => { if (!canNext) return this.changePage(page + 1) }}