You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
593 B
27 lines
593 B
10 years ago
|
var React = require('react');
|
||
|
var Tooltip = require('rc-tooltip');
|
||
|
require('rc-tooltip/assets/bootstrap.css');
|
||
|
|
||
|
module.exports = React.createClass({
|
||
|
getInitialState: function () {
|
||
|
var state = {};
|
||
|
state.placement = this.props.placement;
|
||
|
state.title = this.props.title;
|
||
|
return state;
|
||
|
},
|
||
|
getDefaultProps: function () {
|
||
|
return {
|
||
|
placement: 'top'
|
||
|
};
|
||
|
},
|
||
|
render: function() {
|
||
|
return (
|
||
|
<Tooltip placement={this.state.placement}
|
||
|
trigger="hover"
|
||
|
overlay={this.state.title}>
|
||
|
{this.props.children}
|
||
|
</Tooltip>
|
||
|
);
|
||
|
}
|
||
|
});
|