Creadno lista pero con problemas en paginate
This commit is contained in:
@@ -19,7 +19,7 @@ const range = (from, to, step = 1) => {
|
||||
return range;
|
||||
}
|
||||
|
||||
export class Paginate extends Component {
|
||||
export default class Paginate extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
const {totalRecords = 0, pageLimit = 30, pageNeighbours = 0, currentPage = 1} = props;
|
||||
@@ -135,24 +135,21 @@ export class Paginate extends Component {
|
||||
const blocks = pages.map((page, index) => {
|
||||
if (page === LEFT_PAGE) return (
|
||||
<li key={page} className="page-item">
|
||||
<a className="page-link" href={this.makePageLink(this.state.currentPage - 1)}
|
||||
onClick={this.handleMoveLeft}>
|
||||
<a className="page-link" href={this.makePageLink(this.state.currentPage - 1)} onClick={this.handleMoveLeft}>
|
||||
<span>« Anterior</span>
|
||||
</a>
|
||||
</li>
|
||||
);
|
||||
if (page === RIGHT_PAGE) return (
|
||||
<li key={page} className="page-item">
|
||||
<a className="page-link" href={this.makePageLink(this.state.currentPage + 1)}
|
||||
onClick={this.handleMoveRight}>
|
||||
<a className="page-link" href={this.makePageLink(this.state.currentPage + 1)} onClick={this.handleMoveRight}>
|
||||
<span>Siguiente »</span>
|
||||
</a>
|
||||
</li>
|
||||
);
|
||||
return (
|
||||
<li key={page} className={`page-item ${currentPage === page ? 'active' : ''}`}>
|
||||
<a className="page-link" href={this.makePageLink(index)}
|
||||
onClick={this.handleClick(page)}>{page}</a>
|
||||
<a className="page-link" href={this.makePageLink(page)} onClick={this.handleClick(page)}>{page}</a>
|
||||
</li>
|
||||
);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user