forked from yuristrelets/react-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTabContent.js
More file actions
30 lines (25 loc) · 691 Bytes
/
TabContent.js
File metadata and controls
30 lines (25 loc) · 691 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
import React from 'react';
import style from './style';
class TabContent extends React.Component {
static propTypes = {
active: React.PropTypes.bool,
children: React.PropTypes.node,
className: React.PropTypes.string,
tabIndex: React.PropTypes.number
};
static defaultProps = {
active: false,
className: ''
};
render () {
let className = style.tab;
if (this.props.active) className += ` ${style.active}`;
if (this.props.className) className += ` ${this.props.className}`;
return (
<section className={className} tabIndex={this.props.tabIndex}>
{this.props.children}
</section>
);
}
}
export default TabContent;