Add tooltip to torrent action buttons

This commit is contained in:
John Furrow
2017-02-26 16:48:01 -08:00
parent 87b5c5a576
commit fba6aae3c0
4 changed files with 17 additions and 10 deletions
@@ -1,16 +1,23 @@
import classnames from 'classnames';
import React from 'react';
import StopIcon from '../Icons/StopIcon';
import Tooltip from '../General/Tooltip';
export default class Action extends React.Component {
render() {
let classString = 'action action--' + this.props.slug;
const {clickHandler, icon, label, slug} = this.props;
const classes = classnames('action tooltip__wrapper', {
[`action--${slug}`]: slug != null
});
return (
<div className={classString} onClick={this.props.clickHandler}>
{this.props.icon}
<span className="action__label">{this.props.label}</span>
</div>
<Tooltip content={label}
onClick={clickHandler}
position="bottom"
wrapperClassName={classes}>
{icon}
<span className="action__label">{label}</span>
</Tooltip>
);
}
}