2015-06-05 11:06:36 +02:00
|
|
|
'use strict';
|
|
|
|
|
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-21 17:54:27 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
render() {
|
2015-06-05 11:06:36 +02:00
|
|
|
return (
|
2015-05-21 17:54:27 +02:00
|
|
|
<nav>
|
|
|
|
<ul className="pager">
|
2015-06-05 11:06:36 +02:00
|
|
|
<PaginationButton
|
2015-05-22 12:58:06 +02:00
|
|
|
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}
|
2015-06-05 11:06:36 +02:00
|
|
|
totalPages={this.props.totalPages} />
|
|
|
|
<PaginationButton
|
2015-05-22 12:58:06 +02:00
|
|
|
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}
|
2015-06-05 11:06:36 +02:00
|
|
|
totalPages={this.props.totalPages} />
|
2015-05-21 17:54:27 +02:00
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default Pagination;
|