forked from SpecterOps/BloodHound-Legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGlyphiconSpan.jsx
33 lines (30 loc) · 860 Bytes
/
GlyphiconSpan.jsx
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
import React, { Component } from 'react';
import { If, Then, Else } from 'react-if';
export default class GlyphiconSpan extends Component {
propTypes: {
classes : React.PropTypes.string,
tooltipDir : React.PropTypes.string,
tooltipTitle : React.PropTypes.string,
tooltip : React.PropTypes.bool.isRequired,
click: React.PropTypes.func
}
constructor(props){
super(props);
}
render() {
return (
<If condition={ this.props.tooltip }>
<Then>
<span onClick={this.props.click} className={this.props.classes} data-toggle="tooltip" data-placement={this.props.tooltipDir} title={this.props.tooltipTitle}>
{this.props.children}
</span>
</Then>
<Else>{() =>
<span onClick={this.props.click} className={this.props.classes}>
{this.props.children}
</span>
}</Else>
</If>
);
}
}