-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.jsx
More file actions
35 lines (29 loc) · 1012 Bytes
/
Copy pathindex.jsx
File metadata and controls
35 lines (29 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { connect } from 'react-redux';
import React, { PropTypes } from 'react';
import { Pagination } from 'react-bootstrap';
const TaskPager = (props) => (
<div className='text-center'>
{props.items > 1 && <Pagination
bsSize='small'
{...props}
onSelect={(e, data) => props.onSelect(data.eventKey)}
/>}
</div>
);
TaskPager.propTypes = {
items: PropTypes.number,
activePage: PropTypes.number,
onSelect: PropTypes.func,
};
//import { changePage } from '../state';
import { bindActionCreators } from 'multireducer';
import { getActions } from 'reduxApp/modules/rest';
const tasks = getActions('/api/tasks');
//const mapDispatchToProps = (dispatch) => bindActionCreators({ changePage }, dispatch, 'tasks')
export default connect(
state => ({
items: state.rest.tasks.totalPages,
activePage: state.rest.tasks.page,
}),
(dispatch) => bindActionCreators({ onSelect: tasks.changePage }, dispatch, 'tasks')
)(TaskPager);