2016-06-30 01:21:38 +02:00
|
|
|
const Component = require('react').Component
|
|
|
|
const h = require('react-hyperscript')
|
|
|
|
const inherits = require('util').inherits
|
|
|
|
const ReactTooltip = require('react-tooltip-component')
|
|
|
|
|
|
|
|
module.exports = Tooltip
|
|
|
|
|
|
|
|
inherits(Tooltip, Component)
|
|
|
|
function Tooltip () {
|
|
|
|
Component.call(this)
|
|
|
|
}
|
|
|
|
|
|
|
|
Tooltip.prototype.render = function () {
|
|
|
|
const props = this.props
|
2016-09-07 01:45:06 +02:00
|
|
|
const { position, title, children } = props
|
2016-06-30 01:21:38 +02:00
|
|
|
|
|
|
|
return h(ReactTooltip, {
|
2016-09-07 01:45:06 +02:00
|
|
|
position: position || 'left',
|
|
|
|
title,
|
2017-09-13 01:15:56 +02:00
|
|
|
fixed: true,
|
2016-09-07 01:45:06 +02:00
|
|
|
}, children)
|
2016-06-30 01:21:38 +02:00
|
|
|
}
|