mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-31 01:35:15 +02:00
(Guillermo) info card add components [skip ci]
This commit is contained in:
parent
e0ae9d113e
commit
d8f01dba8e
@ -9,6 +9,7 @@ const Checkbox = require('core-components/checkbox');
|
|||||||
const Widget = require('core-components/widget');
|
const Widget = require('core-components/widget');
|
||||||
const DropDown = require('core-components/drop-down');
|
const DropDown = require('core-components/drop-down');
|
||||||
const Menu = require('core-components/menu');
|
const Menu = require('core-components/menu');
|
||||||
|
const Tooltip = require('core-components/tooltip');
|
||||||
|
|
||||||
let dropDownItems = [{content: 'English'}, {content: 'Spanish'}, {content: 'German'}, {content: 'Portuguese'}, {content: 'Japanese'}];
|
let dropDownItems = [{content: 'English'}, {content: 'Spanish'}, {content: 'German'}, {content: 'Portuguese'}, {content: 'Japanese'}];
|
||||||
let secondaryMenuItems = [
|
let secondaryMenuItems = [
|
||||||
@ -77,6 +78,12 @@ let DemoPage = React.createClass({
|
|||||||
render: (
|
render: (
|
||||||
<Menu items={secondaryMenuItems} type="secondary"/>
|
<Menu items={secondaryMenuItems} type="secondary"/>
|
||||||
)
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Tooltip',
|
||||||
|
render: (
|
||||||
|
<Tooltip content="mensaje adicionalsssssssssssssssss ssssss ssssssssssssssssssss">hola</Tooltip>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
40
client/src/core-components/tooltip.js
Normal file
40
client/src/core-components/tooltip.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
class Tooltip extends React.Component {
|
||||||
|
|
||||||
|
static propTypes = {
|
||||||
|
children: React.PropTypes.node,
|
||||||
|
content: React.PropTypes.node
|
||||||
|
};
|
||||||
|
constructor (props){
|
||||||
|
super(props);
|
||||||
|
this.state = {show : false}
|
||||||
|
}
|
||||||
|
render (){
|
||||||
|
return (
|
||||||
|
<div className="tooltip" >
|
||||||
|
{(this.state.show) ? this.renderMessage() : null}
|
||||||
|
<div className="tooltip__children" onClick={this.onClick.bind(this)}>{this.props.children}</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
renderMessage(){
|
||||||
|
return (
|
||||||
|
<div className="tooltip__message">
|
||||||
|
{this.props.content}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onClick(){
|
||||||
|
if(this.state.show){
|
||||||
|
this.setState({show : false});
|
||||||
|
}else{
|
||||||
|
this.setState({show : true});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export default Tooltip;
|
19
client/src/core-components/tooltip.scss
Normal file
19
client/src/core-components/tooltip.scss
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
.tooltip {
|
||||||
|
position: relative;
|
||||||
|
&__children{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
&__message{
|
||||||
|
position: absolute;
|
||||||
|
bottom: 100%;
|
||||||
|
left: -25%;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
box-shadow: 0 0 4px #8D8D8D;
|
||||||
|
border-radius: 4px;
|
||||||
|
max-width: 200px;
|
||||||
|
background-color: #F7F7F7;
|
||||||
|
color: black;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user