-
Notifications
You must be signed in to change notification settings - Fork 73
/
stateful.js
37 lines (30 loc) · 1.19 KB
/
stateful.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React, { Component } from 'react'
import { StatefulToolTip } from './../..'
export default class Stateful extends Component {
escape(html) {
return document.createElement('div').appendChild(document.createTextNode(html)).parentNode.innerHTML
}
getBasicExample() {
return {
__html: this.escape(`const buttonStateful = <span className="btn btn-default">Hover me Stateful</span>
return <StatefulToolTip parent={ buttonStateful } position="right" arrow="center" className="stateful-button">Stateful Tooltip here!</StatefulToolTip>`)
}
}
render() {
const buttonStateful = <span className="btn btn-default">Hover me Stateful</span>
return (
<div className="row" style={{marginTop: 20}}>
<div className="col-lg-12">
<div style={{marginBottom: 20}}>
Stateful tooltip usage:
<pre dangerouslySetInnerHTML={this.getBasicExample()}/>
</div>
<div style={{ marginBottom: 20 }}>
Stateful:
<StatefulToolTip parent={ buttonStateful } position="right" arrow="center" className="stateful-button">Stateful Tooltip here!</StatefulToolTip>
</div>
</div>
</div>
)
}
}