-
Notifications
You must be signed in to change notification settings - Fork 427
/
Copy pathindex.js
27 lines (22 loc) · 934 Bytes
/
index.js
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
import React from 'react';
import PropTypes from 'prop-types';
import createBaseContext from './src/state-context';
import createDataContext from './src/data-context';
import PaginationListStandalone from './src/pagination-list-standalone';
import SizePerPageDropdownStandalone from './src/size-per-page-dropdown-standalone';
import PaginationTotalStandalone from './src/pagination-total-standalone';
export default (options = {}) => ({
createContext: createDataContext,
options
});
const { Provider, Consumer } = createBaseContext();
const CustomizableProvider = props => (
<Provider { ...props }>
<Consumer>{ paginationProps => props.children(paginationProps) }</Consumer>
</Provider>
);
CustomizableProvider.propTypes = {
children: PropTypes.func.isRequired
};
export const PaginationProvider = CustomizableProvider;
export { PaginationListStandalone, SizePerPageDropdownStandalone, PaginationTotalStandalone };