1 | import _extends from 'babel-runtime/helpers/extends';
|
2 | import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
3 | import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
4 | import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
5 | import _inherits from 'babel-runtime/helpers/inherits';
|
6 | import classNames from 'classnames';
|
7 | import React from 'react';
|
8 | import elementType from 'prop-types-extra/lib/elementType';
|
9 |
|
10 | import MediaBody from './MediaBody';
|
11 | import MediaHeading from './MediaHeading';
|
12 | import MediaLeft from './MediaLeft';
|
13 | import MediaList from './MediaList';
|
14 | import MediaListItem from './MediaListItem';
|
15 | import MediaRight from './MediaRight';
|
16 | import { bsClass, getClassSet, splitBsProps } from './utils/bootstrapUtils';
|
17 |
|
18 | var propTypes = {
|
19 | componentClass: elementType
|
20 | };
|
21 |
|
22 | var defaultProps = {
|
23 | componentClass: 'div'
|
24 | };
|
25 |
|
26 | var Media = function (_React$Component) {
|
27 | _inherits(Media, _React$Component);
|
28 |
|
29 | function Media() {
|
30 | _classCallCheck(this, Media);
|
31 |
|
32 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
33 | }
|
34 |
|
35 | Media.prototype.render = function render() {
|
36 | var _props = this.props,
|
37 | Component = _props.componentClass,
|
38 | className = _props.className,
|
39 | props = _objectWithoutProperties(_props, ['componentClass', 'className']);
|
40 |
|
41 | var _splitBsProps = splitBsProps(props),
|
42 | bsProps = _splitBsProps[0],
|
43 | elementProps = _splitBsProps[1];
|
44 |
|
45 | var classes = getClassSet(bsProps);
|
46 |
|
47 | return React.createElement(Component, _extends({}, elementProps, { className: classNames(className, classes) }));
|
48 | };
|
49 |
|
50 | return Media;
|
51 | }(React.Component);
|
52 |
|
53 | Media.propTypes = propTypes;
|
54 | Media.defaultProps = defaultProps;
|
55 |
|
56 | Media.Heading = MediaHeading;
|
57 | Media.Body = MediaBody;
|
58 | Media.Left = MediaLeft;
|
59 | Media.Right = MediaRight;
|
60 | Media.List = MediaList;
|
61 | Media.ListItem = MediaListItem;
|
62 |
|
63 | export default bsClass('media', Media); |
\ | No newline at end of file |