mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-28 16:24:42 +02:00
commit
26db3b2af3
@ -15,6 +15,7 @@ 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');
|
const Tooltip = require('core-components/tooltip');
|
||||||
const Table = require('core-components/table');
|
const Table = require('core-components/table');
|
||||||
|
const InfoTooltip = require('core-components/info-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 = [
|
||||||
@ -168,6 +169,12 @@ let DemoPage = React.createClass({
|
|||||||
return ans;
|
return ans;
|
||||||
}}/>
|
}}/>
|
||||||
)
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'InfoTooltip',
|
||||||
|
render: (
|
||||||
|
<InfoTooltip type="warning" text="No staff member is assigned to this department." />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
54
client/src/core-components/info-tooltip.js
Normal file
54
client/src/core-components/info-tooltip.js
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
import i18n from 'lib-app/i18n';
|
||||||
|
import Icon from 'core-components/icon';
|
||||||
|
import Tooltip from 'core-components/tooltip';
|
||||||
|
|
||||||
|
class InfoTooltip extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
type: React.PropTypes.oneOf(['default', 'warning']),
|
||||||
|
text: React.PropTypes.string.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
type: 'default'
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
let name = (this.props.type === 'default') ? 'question-circle' : 'exclamation-triangle';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={this.getClass()}>
|
||||||
|
<Tooltip content={this.renderText()} openOnHover>
|
||||||
|
<span className="info-tooltip__icon">
|
||||||
|
<Icon name={name}/>
|
||||||
|
</span>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderText() {
|
||||||
|
let message = (this.props.type === 'default') ? i18n('INFO') : i18n('WARNING');
|
||||||
|
return (
|
||||||
|
<div className="info-tooltip__text">
|
||||||
|
<div className="info-tooltip__text-title">
|
||||||
|
{message}
|
||||||
|
</div>
|
||||||
|
{this.props.text}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getClass() {
|
||||||
|
let classes = {
|
||||||
|
'info-tooltip': true,
|
||||||
|
'info-tooltip_warning': (this.props.type === 'warning')
|
||||||
|
};
|
||||||
|
|
||||||
|
return classNames(classes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default InfoTooltip;
|
26
client/src/core-components/info-tooltip.scss
Normal file
26
client/src/core-components/info-tooltip.scss
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
@import "../scss/vars";
|
||||||
|
|
||||||
|
.info-tooltip {
|
||||||
|
&__text {
|
||||||
|
&-title {
|
||||||
|
color: $secondary-blue;
|
||||||
|
font-size: $font-size--md;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__icon {
|
||||||
|
color: $secondary-blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
&_warning {
|
||||||
|
.info-tooltip__icon {
|
||||||
|
color: $primary-red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-tooltip__text {
|
||||||
|
&-title {
|
||||||
|
color: $primary-red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -72,6 +72,8 @@ export default {
|
|||||||
'UN_ASSIGN': 'Unassign',
|
'UN_ASSIGN': 'Unassign',
|
||||||
'VIEW_TICKET': 'View Ticket',
|
'VIEW_TICKET': 'View Ticket',
|
||||||
'SELECT_CUSTOM_RESPONSE': 'Select a custom response...',
|
'SELECT_CUSTOM_RESPONSE': 'Select a custom response...',
|
||||||
|
'WARNING': 'Warning',
|
||||||
|
'INFO': 'Information',
|
||||||
|
|
||||||
//VIEW DESCRIPTIONS
|
//VIEW DESCRIPTIONS
|
||||||
'CREATE_TICKET_DESCRIPTION': 'This is a form for creating tickets. Fill the form and send us your issues/doubts/suggestions. Our support system will answer it as soon as possible.',
|
'CREATE_TICKET_DESCRIPTION': 'This is a form for creating tickets. Fill the form and send us your issues/doubts/suggestions. Our support system will answer it as soon as possible.',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user