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.

29 lines
649 B

import React from 'react';
import Tooltip from 'rc-tooltip';
10 years ago
export default React.createClass({
getDefaultProps() {
10 years ago
return {
prefixCls: 'ant-tooltip',
placement: 'top',
mouseEnterDelay: 0.1,
mouseLeaveDelay: 0.1
10 years ago
};
},
render() {
let transitionName = ({
top: 'zoom-down',
bottom: 'zoom-up',
left: 'zoom-right',
right: 'zoom-left'
})[this.props.placement];
return (
this.props.title ? <Tooltip transitionName={transitionName}
overlay={this.props.title}
{...this.props}>
10 years ago
{this.props.children}
</Tooltip> : this.props.children
10 years ago
);
}
});