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,
|
|
|
|
currentPage: React.PropTypes.oneOfType([
|
|
|
|
React.PropTypes.string,
|
|
|
|
React.PropTypes.number
|
|
|
|
]).isRequired
|
|
|
|
//itemListCount: React.PropTypes.number.isRequired
|
2015-05-21 17:54:27 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
render() {
|
2015-05-22 13:43:53 +02:00
|
|
|
let currentPage = parseInt(this.props.currentPage, 10);
|
2015-05-21 17:54:27 +02:00
|
|
|
|
|
|
|
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}
|
|
|
|
currentPage={currentPage}>
|
2015-05-22 12:58:06 +02:00
|
|
|
</PaginationButton>
|
|
|
|
<PaginationButton
|
|
|
|
direction='next'
|
2015-05-22 13:43:53 +02:00
|
|
|
goToPage={this.props.goToPage}
|
|
|
|
currentPage={currentPage}>
|
2015-05-22 12:58:06 +02:00
|
|
|
</PaginationButton>
|
2015-05-21 17:54:27 +02:00
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default Pagination;
|