Guillermo - add tooltip [skip ci]

This commit is contained in:
AntonyAntonio 2016-09-03 14:09:46 -03:00
parent 5a409a5f81
commit cbf4dc66f3
1 changed files with 7 additions and 6 deletions

View File

@ -7,10 +7,12 @@ class Tooltip extends React.Component {
children: React.PropTypes.node, children: React.PropTypes.node,
content: React.PropTypes.node content: React.PropTypes.node
}; };
constructor (props){ constructor (props){
super(props); super(props);
this.state = {show : false} this.state = {show : false};
} }
render (){ render (){
return ( return (
<div className="tooltip" > <div className="tooltip" >
@ -19,6 +21,7 @@ class Tooltip extends React.Component {
</div> </div>
); );
} }
renderAnimatedMessage(){ renderAnimatedMessage(){
return ( return (
<Motion defaultStyle={{opacity:spring(0)}} style={{opacity:spring(1)}}> <Motion defaultStyle={{opacity:spring(0)}} style={{opacity:spring(1)}}>
@ -26,6 +29,7 @@ class Tooltip extends React.Component {
</Motion> </Motion>
) )
} }
renderMessage(animation){ renderMessage(animation){
return ( return (
<div style={animation}> <div style={animation}>
@ -37,15 +41,12 @@ class Tooltip extends React.Component {
) )
} }
onClick(){ onClick(){
if(this.state.show){ if (this.state.show) {
this.setState({show : false}); this.setState({show : false});
}else{ } else {
this.setState({show : true}); this.setState({show : true});
} }
} }
} }
export default Tooltip; export default Tooltip;