Skip to content

Commit ee7e174

Browse files
authored
enhancement tooltip ui (#268)
* enhancement tooltip ui * use single quotes
1 parent 9521f4e commit ee7e174

File tree

3 files changed

+54
-20
lines changed

3 files changed

+54
-20
lines changed

src/components/CallingSettingsPanel/i18n/en-US.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,12 @@ export default {
1111
ringoutHint: 'Ring me at my location first, then connect the called party',
1212
myLocationLabel: 'My Location',
1313
press1ToStartCallLabel: 'Prompt me to dial 1 before connecting the call',
14-
[`${callingOptions.browser}Tooltip`]: `Use this option to make and receive calls
15-
using your computer’s microphone and speaker.`,
16-
[`${callingOptions.softphone}Tooltip`]: `Use this option to make and receive calls
17-
using your {brand} for Desktop app.`,
14+
[`${callingOptions.browser}Tooltip`]: 'Use this option to make and receive calls using your computer’s microphone and speaker.',
15+
[`${callingOptions.softphone}Tooltip`]: 'Use this option to make and receive calls using your {brand} for Desktop app.',
1816
[`${callingOptions.myphone}Tooltip`]: 'Use this option to make calls using your {brand} phone.',
19-
[`${callingOptions.otherphone}Tooltip`]: `Use this option to make calls using your other phones
20-
such as home or cell phones that you have added in your {brand} Extension.
21-
For the call you make, this phone will ring first then the party you called.`,
22-
[`${callingOptions.customphone}Tooltip`]: `Use this option to make calls using any phone of
23-
your choice by entering a valid phone number in the field below.
24-
For the call you make, this phone will ring first then the party you called.`,
17+
[`${callingOptions.myphone}Tooltip1`]: 'For the call you make, your {brand} phone will ring first then the party you called.',
18+
[`${callingOptions.otherphone}Tooltip`]: 'Use this option to make calls using your other phones such as home or cell phones that you have added in your {brand} Extension.',
19+
[`${callingOptions.otherphone}Tooltip1`]: 'For the call you make, this phone will ring first then the party you called.',
20+
[`${callingOptions.customphone}Tooltip`]: 'Use this option to make calls using any phone of your choice by entering a valid phone number in the field below.',
21+
[`${callingOptions.customphone}Tooltip1`]: 'For the call you make, this phone will ring first then the party you called.',
2522
};

src/components/CallingSettingsPanel/index.js

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,37 @@ export default class CallingSettingsPanel extends Component {
9595
ringoutPrompt: checked,
9696
});
9797
}
98+
99+
getTooltipContent() {
100+
let contentKeys;
101+
if (this.state.callWith === callingOptions.browser
102+
|| this.state.callWith === callingOptions.softphone
103+
) {
104+
contentKeys = [`${this.state.callWith}Tooltip`];
105+
} else {
106+
contentKeys = [`${this.state.callWith}Tooltip`, `${this.state.callWith}Tooltip1`];
107+
}
108+
return (
109+
<div>
110+
{
111+
contentKeys.map(contentKey => (
112+
<div key={contentKey}>
113+
{formatMessage(
114+
i18n.getString(contentKey, this.props.currentLocale),
115+
{ brand: this.props.brand }
116+
)}
117+
</div>
118+
))
119+
}
120+
</div>
121+
);
122+
}
123+
98124
renderHandler = (option) => {
99125
const brand = this.props.brand;
100126
return formatMessage(i18n.getString(option, this.props.currentLocale), { brand });
101127
}
128+
102129
render() {
103130
const {
104131
currentLocale,
@@ -173,16 +200,7 @@ export default class CallingSettingsPanel extends Component {
173200
</div>
174201
) : null;
175202

176-
const toolTip = (
177-
<div style={{ width: 150 }}>
178-
{
179-
formatMessage(
180-
i18n.getString(`${this.state.callWith}Tooltip`, currentLocale),
181-
{ brand: this.props.brand }
182-
)
183-
}
184-
</div>
185-
);
203+
const toolTip = this.getTooltipContent();
186204
return (
187205
<div className={classnames(styles.root, className)}>
188206
<BackHeader
@@ -201,7 +219,11 @@ export default class CallingSettingsPanel extends Component {
201219
placement="bottom"
202220
trigger="click"
203221
overlay={toolTip}
222+
align={{
223+
offset: [0, 47],
224+
}}
204225
arrowContent={<div className="rc-tooltip-arrow-inner" />}
226+
getTooltipContainer={() => this.tooltipContainner}
205227
>
206228
<i className={classnames(dynamicsFont.information, styles.infoIcon)} />
207229
</Tooltip>
@@ -220,6 +242,12 @@ export default class CallingSettingsPanel extends Component {
220242
disabled={disabled}
221243
titleEnabled
222244
/>
245+
<div
246+
className={styles.tooltipContainner}
247+
ref={(tooltipContainner) => {
248+
this.tooltipContainner = tooltipContainner;
249+
}}
250+
/>
223251
</InputField>
224252
{ringout}
225253
</Panel>

src/components/CallingSettingsPanel/styles.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@
3030
color: #848484;
3131
}
3232

33+
.tooltipContainner {
34+
width: 100%;
35+
height: 1px;
36+
:global .rc-tooltip {
37+
opacity: 1;
38+
left: 0!important;
39+
}
40+
}
41+
3342
.ringoutHint {
3443
padding: 15px 0px;
3544
@include primary-font;

0 commit comments

Comments
 (0)