2015-05-21 17:54:27 +02:00
|
|
|
import React from 'react';
|
|
|
|
|
2015-05-22 12:58:06 +02:00
|
|
|
import PaginationButton from './pagination_button';
|
2015-05-21 17:54:27 +02:00
|
|
|
|
|
|
|
let Pagination = React.createClass({
|
2015-05-22 12:58:06 +02:00
|
|
|
propTypes: {
|
2015-05-22 13:43:53 +02:00
|
|
|
goToPage: React.PropTypes.func.isRequired,
|
2015-05-22 17:11:17 +02:00
|
|
|
currentPage: React.PropTypes.number.isRequired,
|
|
|
|
totalPages: React.PropTypes.number.isRequired
|
2015-05-22 13:43:53 +02:00
|
|
|
//itemListCount: React.PropTypes.number.isRequired
|
2015-05-21 17:54:27 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return(
|
|
|
|
<nav>
|
|
|
|
<ul className="pager">
|
2015-05-22 12:58:06 +02:00
|
|
|
<PaginationButton
|
|
|
|
direction='previous'
|
2015-05-22 13:43:53 +02:00
|
|
|
goToPage={this.props.goToPage}
|
2015-05-22 17:11:17 +02:00
|
|
|
currentPage={this.props.currentPage}
|
|
|
|
totalPages={this.props.totalPages}>
|
2015-05-22 12:58:06 +02:00
|
|
|
</PaginationButton>
|
|
|
|
<PaginationButton
|
|
|
|
direction='next'
|
2015-05-22 13:43:53 +02:00
|
|
|
goToPage={this.props.goToPage}
|
2015-05-22 17:11:17 +02:00
|
|
|
currentPage={this.props.currentPage}
|
|
|
|
totalPages={this.props.totalPages}>
|
2015-05-22 12:58:06 +02:00
|
|
|
</PaginationButton>
|
2015-05-21 17:54:27 +02:00
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default Pagination;
|