mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* Interface linting rule * fix: changed model names in store files so that the interface names do not conflict with the model names
35 lines
731 B
TypeScript
35 lines
731 B
TypeScript
import React from 'react';
|
|
import withTooltip from './withTooltip';
|
|
import { Target } from 'react-popper';
|
|
|
|
interface PopoverProps {
|
|
tooltipSetState: (prevState: object) => void;
|
|
}
|
|
|
|
class Popover extends React.Component<PopoverProps, any> {
|
|
constructor(props) {
|
|
super(props);
|
|
this.toggleTooltip = this.toggleTooltip.bind(this);
|
|
}
|
|
|
|
toggleTooltip() {
|
|
const { tooltipSetState } = this.props;
|
|
tooltipSetState(prevState => {
|
|
return {
|
|
...prevState,
|
|
show: !prevState.show,
|
|
};
|
|
});
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<Target className="popper__target" onClick={this.toggleTooltip}>
|
|
{this.props.children}
|
|
</Target>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default withTooltip(Popover);
|