UNPKG

1.6 kBJavaScriptView Raw
1import _extends from 'babel-runtime/helpers/extends';
2import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
3import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
4import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
5import _inherits from 'babel-runtime/helpers/inherits';
6import classNames from 'classnames';
7import React from 'react';
8import elementType from 'prop-types-extra/lib/elementType';
9
10import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
11
12var propTypes = {
13 componentClass: elementType
14};
15
16var defaultProps = {
17 componentClass: 'div'
18};
19
20var ModalBody = function (_React$Component) {
21 _inherits(ModalBody, _React$Component);
22
23 function ModalBody() {
24 _classCallCheck(this, ModalBody);
25
26 return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
27 }
28
29 ModalBody.prototype.render = function render() {
30 var _props = this.props,
31 Component = _props.componentClass,
32 className = _props.className,
33 props = _objectWithoutProperties(_props, ['componentClass', 'className']);
34
35 var _splitBsProps = splitBsProps(props),
36 bsProps = _splitBsProps[0],
37 elementProps = _splitBsProps[1];
38
39 var classes = getClassSet(bsProps);
40
41 return React.createElement(Component, _extends({}, elementProps, { className: classNames(className, classes) }));
42 };
43
44 return ModalBody;
45}(React.Component);
46
47ModalBody.propTypes = propTypes;
48ModalBody.defaultProps = defaultProps;
49
50export default bsClass('modal-body', ModalBody);
\No newline at end of file