Skip to content
This repository has been archived by the owner on May 7, 2019. It is now read-only.

Commit

Permalink
Pager is having react upgrade issue (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebigun authored and daguiler committed Jan 17, 2019
1 parent b6a0b50 commit b31884d
Showing 1 changed file with 41 additions and 36 deletions.
77 changes: 41 additions & 36 deletions src/Pager/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,44 +241,49 @@ class Pager extends Component {
}
render() {
const { state, props } = this;
return (state.totalPages > 1 || (props.totalRecords >= 10 && state.totalPages === 1 && this.props.showPageSizeOptions)) &&
<div className="dnn-pager do-not-close" style={props.style}>
<div className="dnn-pager-summary-box">
{this.getPageSummary()}
</div>
<div className="dnn-pager-control">
<div className="dnn-pager-paging-box">
<ul>
{
this.props.showStartEndButtons &&
this.renderIcon(this.onPageChanged.bind(this, "<<"), ArrowEndLeftIcon, state.currentPage < 1)
}
{
this.renderIcon(this.onPageChanged.bind(this, "<"), ArrowLeftIcon, state.currentPage < 1)
}
{this.getPagingBoxes()}
{
this.renderIcon(this.onPageChanged.bind(this, ">"), ArrowRightIcon, state.totalPages <= (state.currentPage + 1))
}
{
this.props.showStartEndButtons &&
this.renderIcon(this.onPageChanged.bind(this, ">>"), ArrowEndRightIcon, state.totalPages <= (state.currentPage + 1))
}
</ul>
if (state.totalPages > 1 || (props.totalRecords >= 10 && state.totalPages === 1 && this.props.showPageSizeOptions)) {
return (
<div className="dnn-pager do-not-close" style={props.style}>
<div className="dnn-pager-summary-box">
{this.getPageSummary()}
</div>
{this.props.showPageInfo && !this.props.showPageSizeOptions &&
<div className="dnn-pager-options-info-box">
{this.format(this.props.pageInfoText, this.formatCommaSeparate(state.currentPage + 1), this.formatCommaSeparate(state.totalPages))}
<div className="dnn-pager-control">
<div className="dnn-pager-paging-box">
<ul>
{
this.props.showStartEndButtons &&
this.renderIcon(this.onPageChanged.bind(this, "<<"), ArrowEndLeftIcon, state.currentPage < 1)
}
{
this.renderIcon(this.onPageChanged.bind(this, "<"), ArrowLeftIcon, state.currentPage < 1)
}
{this.getPagingBoxes()}
{
this.renderIcon(this.onPageChanged.bind(this, ">"), ArrowRightIcon, state.totalPages <= (state.currentPage + 1))
}
{
this.props.showStartEndButtons &&
this.renderIcon(this.onPageChanged.bind(this, ">>"), ArrowEndRightIcon, state.totalPages <= (state.currentPage + 1))
}
</ul>
</div>
}
{
this.props.showPageSizeOptions &&
<div className="dnn-pager-pageSize-box">
{this.getPageSizeDropDown()}
</div>
}
</div>
</div >;
{this.props.showPageInfo && !this.props.showPageSizeOptions &&
<div className="dnn-pager-options-info-box">
{this.format(this.props.pageInfoText, this.formatCommaSeparate(state.currentPage + 1), this.formatCommaSeparate(state.totalPages))}
</div>
}
{
this.props.showPageSizeOptions &&
<div className="dnn-pager-pageSize-box">
{this.getPageSizeDropDown()}
</div>
}
</div>
</div >
);
} else {
return <div />;
}
}
}
Pager.propTypes = {
Expand Down

0 comments on commit b31884d

Please sign in to comment.