UNPKG

1.5 kBJavaScriptView Raw
1import _extends from 'babel-runtime/helpers/extends';
2import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
3import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
4import _inherits from 'babel-runtime/helpers/inherits';
5import PropTypes from 'prop-types';
6import React from 'react';
7import cn from 'classnames';
8import { prefix, bsClass, splitBsProps } from './utils/bootstrapUtils';
9
10var contextTypes = {
11 $bs_panel: PropTypes.shape({
12 bsClass: PropTypes.string
13 })
14};
15
16var 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
51PanelFooter.contextTypes = contextTypes;
52
53export default bsClass('panel', PanelFooter);
\No newline at end of file