UNPKG

@ftrack/react-toolbox

Version:

A set of React components implementing Google's Material Design specification with the power of CSS Modules.

39 lines (33 loc) 912 B
import PropTypes from 'prop-types'; import React, { Component } from 'react'; import classnames from 'classnames'; import { themr } from 'react-css-themr'; import { TABS } from '../identifiers.js'; class TabContent extends Component { static propTypes = { active: PropTypes.bool, children: PropTypes.node, className: PropTypes.string, tabIndex: PropTypes.number, theme: PropTypes.shape({ active: PropTypes.string, tab: PropTypes.string }) }; static defaultProps = { active: false, className: '' }; render () { const className = classnames(this.props.theme.tab, { [this.props.theme.active]: this.props.active }, this.props.className); return ( <section className={className} tabIndex={this.props.tabIndex}> {this.props.children} </section> ); } } export default themr(TABS)(TabContent); export { TabContent };