Skip to content

Commit

Permalink
Use ClassNames in Tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
javivelasco committed Nov 28, 2015
1 parent 35f8f12 commit db43b19
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/tooltip/Tooltip.jsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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}>
Expand Down

0 comments on commit db43b19

Please sign in to comment.