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.
mvfront-react/src/components/form/HelpButton.js

41 lines
1.0 KiB

import React, {Component} from "react";
import {Tooltip} from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faQuestionCircle } from '@fortawesome/free-solid-svg-icons';
class HelpButton extends Component {
constructor(props) {
super(props);
this.toggle = this.toggle.bind(this);
this.state = {
tooltipOpen: false
};
}
toggle() {
this.setState({
tooltipOpen: !this.state.tooltipOpen
});
}
render(){
return (<div>
<FontAwesomeIcon icon={faQuestionCircle} id={this.props.id+"_"} />
</div>);
}
badrender() {
return (
<div >
<Tooltip placement="right" isOpen={this.state.tooltipOpen} target={this.props.id+"_"} toggle={this.toggle}>
{this.props.children}
</Tooltip>
<FontAwesomeIcon icon={faQuestionCircle} id={this.props.id+"_"} />
</div>
);
}
}
export default HelpButton;