-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathPanel.js
More file actions
38 lines (34 loc) · 781 Bytes
/
Panel.js
File metadata and controls
38 lines (34 loc) · 781 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
import React from 'react';
var Panel = React.createClass({
onHeading(e) {
e.preventDefault();
e.stopPropagation();
this.props.onHeading();
},
render() {
const {
children,
title,
collapse,
kind = 'default',
} = this.props;
const expand = collapse ? '' : 'in';
return (
<div className={`panel panel-${kind}`}>
<div className="panel-heading">
<h4 className="panel-title">
<a href="#" onClick={this.onHeading}>
{title}
</a>
</h4>
</div>
<div className={`panel-collapse collapse ${expand}`}>
<div className="panel-body">
{children}
</div>
</div>
</div>
);
}
});
export default Panel;