1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00
onion/js/components/pagination.js
2015-05-22 13:43:53 +02:00

38 lines
1.1 KiB
JavaScript

import React from 'react';
import PaginationButton from './pagination_button';
let Pagination = React.createClass({
propTypes: {
goToPage: React.PropTypes.func.isRequired,
currentPage: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number
]).isRequired
//itemListCount: React.PropTypes.number.isRequired
},
render() {
let currentPage = parseInt(this.props.currentPage, 10);
return(
<nav>
<ul className="pager">
<PaginationButton
direction='previous'
goToPage={this.props.goToPage}
currentPage={currentPage}>
</PaginationButton>
<PaginationButton
direction='next'
goToPage={this.props.goToPage}
currentPage={currentPage}>
</PaginationButton>
</ul>
</nav>
);
}
});
export default Pagination;