Skip to content

Commit 4864f16

Browse files
committed
refactor render code
1 parent b9fcc33 commit 4864f16

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Pagination.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,9 @@ class Pagination extends React.Component {
414414
onClick={this.prev}
415415
tabIndex={this.hasPrev() ? 0 : null}
416416
onKeyPress={this.runIfEnterPrev}
417-
className={`${
418-
this.hasPrev() ? '' : `${prefixCls}-disabled`
419-
} ${prefixCls}-prev`}
417+
className={classNames(`${prefixCls}-prev`, {
418+
[`${prefixCls}-disabled`]: !this.hasPrev(),
419+
})}
420420
aria-disabled={!this.hasPrev()}
421421
>
422422
{this.renderPrev(prevPage)}
@@ -441,9 +441,9 @@ class Pagination extends React.Component {
441441
onClick={this.next}
442442
tabIndex={this.hasPrev() ? 0 : null}
443443
onKeyPress={this.runIfEnterNext}
444-
className={`${
445-
this.hasNext() ? '' : `${prefixCls}-disabled`
446-
} ${prefixCls}-next`}
444+
className={classNames(`${prefixCls}-next`, {
445+
[`${prefixCls}-disabled`]: !this.hasNext(),
446+
})}
447447
aria-disabled={!this.hasNext()}
448448
>
449449
{this.renderNext(nextPage)}

0 commit comments

Comments
 (0)