-
Notifications
You must be signed in to change notification settings - Fork 375
Expand file tree
/
Copy pathPaginationContainer.js
More file actions
32 lines (29 loc) · 1.03 KB
/
PaginationContainer.js
File metadata and controls
32 lines (29 loc) · 1.03 KB
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
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from '../utils/griddleConnect';
import compose from 'recompose/compose';
import mapProps from 'recompose/mapProps';
import getContext from 'recompose/getContext';
//import { classNamesForComponentSelector, stylesForComponentSelector } from '../selectors/dataSelectors';
const EnhancedPaginationContainer = OriginalComponent => compose(
getContext({
components: PropTypes.object,
selectors: PropTypes.object
}),
connect(
(state, props) => ({
className: props.selectors.classNamesForComponentSelector(state, 'Pagination'),
style: props.selectors.stylesForComponentSelector(state, 'Pagination'),
})
),
mapProps((props) => {
const { components, ...otherProps } = props;
return {
Next: components.NextButton,
Previous: components.PreviousButton,
PageDropdown: components.PageDropdown,
...otherProps
};
})
)((props) => <OriginalComponent {...props} />);
export default EnhancedPaginationContainer;