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) }}