forked from react-bootstrap/react-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPanelFooter.js
More file actions
42 lines (34 loc) · 947 Bytes
/
PanelFooter.js
File metadata and controls
42 lines (34 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React, { PropTypes } from 'react';
import cn from 'classnames';
import { prefix, bsClass, splitBsProps } from './utils/bootstrapUtils';
const propTypes = {
bsRole: PropTypes.string,
};
const defaultProps = {
bsRole: 'footer',
};
const contextTypes = {
$bs_panel: PropTypes.shape({
bsClass: PropTypes.string,
}),
};
class PanelFooter extends React.Component {
render() {
let { children, className } = this.props;
let { bsClass: _bsClass } = this.context.$bs_panel || {};
const [bsProps, elementProps] = splitBsProps(this.props);
bsProps.bsClass = _bsClass || bsProps.bsClass;
return (
<div
{...elementProps}
className={cn(className, prefix(bsProps, 'footer'))}
>
{children}
</div>
);
}
}
PanelFooter.propTypes = propTypes;
PanelFooter.defaultProps = defaultProps;
PanelFooter.contextTypes = contextTypes;
export default bsClass('panel', PanelFooter);