chayns-components
Version:
A set of beautiful React components for developing chayns® applications.
19 lines (18 loc) • 708 B
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import React from 'react';
import ExpandableContext from './ExpandableContext';
export default function connectExpandableContext(WrappedComponent) {
// eslint-disable-next-line react/display-name
return _ref => {
let {
...props
} = _ref;
return /*#__PURE__*/React.createElement(ExpandableContext.Consumer, null, context => /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, props, {
open: context && context.open,
onOpen: context && context.onOpen,
onClose: context && context.onClose,
onToggle: context && context.onToggle
})));
};
}
//# sourceMappingURL=connectExpandableContext.js.map