mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
27 lines
832 B
JavaScript
27 lines
832 B
JavaScript
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';
|
|
|
|
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 };
|