-
Notifications
You must be signed in to change notification settings - Fork 342
/
tooltip.tsx
63 lines (59 loc) · 2.37 KB
/
tooltip.tsx
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import * as React from 'react'
import classNames from 'classnames'
const styles = require('./tooltip.css')
export interface Props {
children: React.ReactNode
position: string
itemClass?: string
toolTipType?: string
}
class Tooltip extends React.PureComponent<Props> {
render() {
return (
<span
className={classNames(styles.tooltip, {
[styles.searchBar]: this.props.toolTipType === 'searchBar',
})}
>
<div
className={classNames(
styles.tooltipBubble,
this.props.itemClass,
{
[styles.tooltipleft]:
this.props.position === 'left' ||
this.props.position === 'leftSmallWidth',
[styles.tooltipright]:
this.props.position === 'right',
[styles.tooltipbottom]:
this.props.position === 'bottom',
[styles.tooltiptop]: this.props.position === 'top',
[styles.tooltipDate]:
this.props.position === 'tooltipDate',
[styles.tooltipBottomLeft]:
this.props.position === 'bottomLeft',
[styles.inPageTooltip]:
this.props.position === 'inpage',
[styles.leftTutorial]:
this.props.position === 'leftTutorial',
},
)}
>
<div
className={classNames(styles.tooltipContent, {
[styles.tooltipContentDate]:
this.props.position === 'tooltipDate',
[styles.leftSmallWidth]:
this.props.position === 'leftSmallWidth',
[styles.leftTutorial]:
this.props.position === 'leftTutorial',
})}
>
{this.props.children}
</div>
</div>
</span>
)
}
}
export default Tooltip