| 3 | import ReactTooltip from 'react-tooltip' |
| 4 | |
| 5 | export default class App extends Component { |
| 6 | constructor(props) { |
| 7 | super(props) |
| 8 | this.state = { |
| 9 | place: 'top', |
| 10 | type: 'dark', |
| 11 | effect: 'float', |
| 12 | condition: false, |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | changePlace(place) { |
| 17 | this.setState({ |
| 18 | place, |
| 19 | }) |
| 20 | } |
| 21 | |
| 22 | changeType(type) { |
| 23 | this.setState({ |
| 24 | type, |
| 25 | }) |
| 26 | } |
| 27 | |
| 28 | changeEffect(effect) { |
| 29 | this.setState({ |
| 30 | effect, |
| 31 | }) |
| 32 | } |
| 33 | |
| 34 | _onClick() { |
| 35 | this.setState({ |
| 36 | condition: true, |
| 37 | }) |
| 38 | } |
| 39 | |
| 40 | render() { |
| 41 | const { place, type, effect } = this.state |
| 42 | return ( |
| 43 | <div> |
| 44 | <section className="tooltip-example"> |
| 45 | <h4 className="title">React Tooltip - V4</h4> |
| 46 | <div className="demonstration"> |
| 47 | <a data-for="main" data-tip="Hello<br />multiline<br />tooltip" data-iscapture="true"> |
| 48 | ◕‿‿◕ |
| 49 | </a> |
| 50 | </div> |
| 51 | <div className="control-panel"> |
| 52 | <div className="button-group"> |
| 53 | <div className="item"> |
| 54 | <p>Place</p> |
| 55 | <a |
| 56 | className={place === 'top' ? 'active' : ''} |
| 57 | onClick={this.changePlace.bind(this, 'top')} |
| 58 | > |
| 59 | Top<span className="mark">(default)</span> |
| 60 | </a> |
| 61 | <a |
| 62 | className={place === 'right' ? 'active' : ''} |
nothing calls this directly
no outgoing calls
no test coverage detected