Use ClassNames in Tooltip

old
Javi Velasco 2015-11-28 20:21:52 +01:00
parent 35f8f12ae6
commit db43b1948e
1 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import ClassNames from 'classnames';
import style from './style';
const HIDE_TIMEOUT = 100;
@ -53,9 +54,9 @@ class Tooltip extends React.Component {
};
render () {
let className = style.root;
if (this.props.className) className += ` ${this.props.className}`;
if (this.state.active) className += ` ${style.active}`;
const className = ClassNames(style.root, {
[style.active]: this.state.active
}, this.props.className);
return (
<span data-react-toolbox='tooltip' className={className}>