Skip to content

Instantly share code, notes, and snippets.

@ovpv

ovpv/tab.js Secret

Last active March 23, 2019 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ovpv/33f97f003635bc23a7fea5fc30980ab7 to your computer and use it in GitHub Desktop.
Save ovpv/33f97f003635bc23a7fea5fc30980ab7 to your computer and use it in GitHub Desktop.
Tab Component class
class Tab extends React.Component{
render(){
return(
<div className="tab">
<div className="title flex jc-btwn">
<span>{this.props.title}</span>
<i className={this.props.active?"fas fa-minus" : "fas fa-plus"}></i>
</div>
<div className={this.props.active ? "content show" : "content hide"}>
{this.props.content}
</div>
</div>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment