From 1993865f14f408f4d445b398e1a64ac21d7a5519 Mon Sep 17 00:00:00 2001 From: zy410419243 Date: Sat, 22 Dec 2018 11:30:28 +0800 Subject: [PATCH] pref: remove useless code --- src/Pagination.jsx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Pagination.jsx b/src/Pagination.jsx index 4fbd6025..b0bce02e 100644 --- a/src/Pagination.jsx +++ b/src/Pagination.jsx @@ -129,11 +129,11 @@ export default class Pagination extends React.Component { } } - getJumpPrevPage() { + getJumpPrevPage = () => { return Math.max(1, this.state.current - (this.props.showLessItems ? 3 : 5)); } - getJumpNextPage() { + getJumpNextPage = () => { return Math.min(this.calculatePage(), this.state.current + (this.props.showLessItems ? 3 : 5)); } @@ -263,14 +263,6 @@ export default class Pagination extends React.Component { } } - getJumpPrevPage() { - return Math.max(1, this.state.current - (this.props.showLessItems ? 3 : 5)); - } - - getJumpNextPage() { - return Math.min(this.calculatePage(), this.state.current + (this.props.showLessItems ? 3 : 5)); - } - jumpPrev = () => { this.handleChange(this.getJumpPrevPage()); }