2018-10-25 16:56:49 +02:00
|
|
|
|
import React, { PureComponent } from 'react';
|
2018-11-14 21:39:13 +01:00
|
|
|
|
import Popper from './Popper';
|
|
|
|
|
|
import withPopper, { UsingPopperProps } from './withPopper';
|
2018-01-10 10:27:33 +01:00
|
|
|
|
|
2018-11-14 21:39:13 +01:00
|
|
|
|
class Tooltip extends PureComponent<UsingPopperProps> {
|
2018-01-10 10:27:33 +01:00
|
|
|
|
render() {
|
2018-11-14 21:39:13 +01:00
|
|
|
|
const { children, hidePopper, showPopper, className, ...restProps } = this.props;
|
|
|
|
|
|
|
2018-01-10 10:27:33 +01:00
|
|
|
|
return (
|
2018-11-14 21:39:13 +01:00
|
|
|
|
<div className={`popper__manager ${className}`} onMouseEnter={showPopper} onMouseLeave={hidePopper}>
|
|
|
|
|
|
<Popper {...restProps}>{children}</Popper>
|
|
|
|
|
|
</div>
|
2018-01-10 10:27:33 +01:00
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2018-11-14 21:39:13 +01:00
|
|
|
|
export default withPopper(Tooltip);
|