1 | import _extends from 'babel-runtime/helpers/extends';
|
2 | import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
3 | import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
4 | import _inherits from 'babel-runtime/helpers/inherits';
|
5 | import PropTypes from 'prop-types';
|
6 | import React from 'react';
|
7 | import cn from 'classnames';
|
8 | import { prefix, bsClass, splitBsProps } from './utils/bootstrapUtils';
|
9 |
|
10 | var contextTypes = {
|
11 | $bs_panel: PropTypes.shape({
|
12 | bsClass: PropTypes.string
|
13 | })
|
14 | };
|
15 |
|
16 | var PanelFooter = function (_React$Component) {
|
17 | _inherits(PanelFooter, _React$Component);
|
18 |
|
19 | function PanelFooter() {
|
20 | _classCallCheck(this, PanelFooter);
|
21 |
|
22 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
23 | }
|
24 |
|
25 | PanelFooter.prototype.render = function render() {
|
26 | var _props = this.props,
|
27 | children = _props.children,
|
28 | className = _props.className;
|
29 |
|
30 | var _ref = this.context.$bs_panel || {},
|
31 | _bsClass = _ref.bsClass;
|
32 |
|
33 | var _splitBsProps = splitBsProps(this.props),
|
34 | bsProps = _splitBsProps[0],
|
35 | elementProps = _splitBsProps[1];
|
36 |
|
37 | bsProps.bsClass = _bsClass || bsProps.bsClass;
|
38 |
|
39 | return React.createElement(
|
40 | 'div',
|
41 | _extends({}, elementProps, {
|
42 | className: cn(className, prefix(bsProps, 'footer'))
|
43 | }),
|
44 | children
|
45 | );
|
46 | };
|
47 |
|
48 | return PanelFooter;
|
49 | }(React.Component);
|
50 |
|
51 | PanelFooter.contextTypes = contextTypes;
|
52 |
|
53 | export default bsClass('panel', PanelFooter); |
\ | No newline at end of file |