Lightcord/BetterDiscordApp/src/ui/tooltipWrap.js

23 lines
552 B
JavaScript
Raw Normal View History

2020-09-05 22:50:45 +02:00
import BDV2 from "../modules/v2";
import Tooltip from "./tooltip";
export default class extends React.Component {
constructor(props) {
super(props);
}
async componentDidMount() {
const {style = "black", side = "top", text = ""} = this.props;
this.node = BDV2.reactDom.findDOMNode(this);
this.tooltip = new Tooltip(this.node, text, {style, side});
}
componentWillUnmount() {
this.tooltip.hide();
delete this.tooltip;
}
render() {
return this.props.children;
}
2020-05-16 23:24:51 +02:00
}