@@ -6,9 +6,10 @@ import {
6
6
RcListItemAvatar ,
7
7
RcAvatar ,
8
8
RcIcon ,
9
+ RcTooltip ,
9
10
styled ,
10
11
} from '@ringcentral/juno' ;
11
- import { People } from '@ringcentral/juno-icon' ;
12
+ import { People , IdBorder } from '@ringcentral/juno-icon' ;
12
13
import ContactDisplay from '@ringcentral-integration/widgets/components/ContactDisplay' ;
13
14
14
15
const StyledItem = styled ( RcListItem ) `
@@ -27,7 +28,6 @@ const StyledItem = styled(RcListItem)`
27
28
.ContactDisplay_root {
28
29
vertical-align: bottom;
29
30
font-family: Lato, Helvetica, Arial, sans-serif;
30
- flex: 1;
31
31
overflow: hidden;
32
32
33
33
> div {
@@ -42,6 +42,10 @@ const StyledItem = styled(RcListItem)`
42
42
margin-right: auto;
43
43
` ;
44
44
45
+ const StyledCallerIDIcon = styled ( RcIcon ) `
46
+ margin-left: 5px;
47
+ ` ;
48
+
45
49
type CallInfoProps = {
46
50
phoneNumber ?: string ;
47
51
formatPhone : ( ...args : any [ ] ) => any ;
@@ -59,6 +63,7 @@ type CallInfoProps = {
59
63
phoneTypeRenderer ?: ( ...args : any [ ] ) => any ;
60
64
phoneSourceNameRenderer ?: ( ...args : any [ ] ) => any ;
61
65
callQueueName ?: string ;
66
+ showCallerIdName : boolean ;
62
67
} ;
63
68
const CallInfo : FunctionComponent < CallInfoProps > = ( {
64
69
nameMatches = [ ] ,
@@ -77,6 +82,7 @@ const CallInfo: FunctionComponent<CallInfoProps> = ({
77
82
areaCode,
78
83
countryCode,
79
84
onSelectMatcherName,
85
+ showCallerIdName,
80
86
} ) => {
81
87
return (
82
88
< StyledItem
@@ -103,27 +109,49 @@ const CallInfo: FunctionComponent<CallInfoProps> = ({
103
109
< RcListItemText
104
110
primary = {
105
111
< >
106
- { callQueueName }
107
- < ContactDisplay
108
- formatPhone = { formatPhone }
109
- contactMatches = { nameMatches }
110
- phoneNumber = { phoneNumber }
111
- fallBackName = { fallBackName }
112
- currentLocale = { currentLocale }
113
- areaCode = { areaCode }
114
- countryCode = { countryCode }
115
- showType = { false }
116
- selected = { selectedMatcherIndex }
117
- onSelectContact = { onSelectMatcherName }
118
- isLogging = { false }
119
- enableContactFallback
120
- brand = { brand }
121
- showPlaceholder = { showContactDisplayPlaceholder }
122
- // @ts -expect-error TS(2322): Type 'object | undefined' is not assignable to typ... Remove this comment to see the full error message
123
- sourceIcons = { sourceIcons }
124
- phoneTypeRenderer = { phoneTypeRenderer }
125
- phoneSourceNameRenderer = { phoneSourceNameRenderer }
126
- />
112
+ {
113
+ callQueueName && ! showCallerIdName && (
114
+ < span data-sign = "callQueueName" >
115
+ { callQueueName }
116
+ </ span >
117
+ )
118
+ }
119
+ {
120
+ showCallerIdName ? (
121
+ < >
122
+ < span data-sign = "callerId" title = { fallBackName } >
123
+ { fallBackName }
124
+ </ span >
125
+ < RcTooltip title = "Caller ID" >
126
+ < StyledCallerIDIcon
127
+ symbol = { IdBorder }
128
+ size = "medium"
129
+ />
130
+ </ RcTooltip >
131
+ </ >
132
+ ) : (
133
+ < ContactDisplay
134
+ formatPhone = { formatPhone }
135
+ contactMatches = { nameMatches }
136
+ phoneNumber = { phoneNumber }
137
+ fallBackName = { fallBackName }
138
+ currentLocale = { currentLocale }
139
+ areaCode = { areaCode }
140
+ countryCode = { countryCode }
141
+ showType = { false }
142
+ selected = { selectedMatcherIndex }
143
+ onSelectContact = { onSelectMatcherName }
144
+ isLogging = { false }
145
+ enableContactFallback
146
+ brand = { brand }
147
+ showPlaceholder = { showContactDisplayPlaceholder }
148
+ // @ts -expect-error TS(2322): Type 'object | undefined' is not assignable to typ... Remove this comment to see the full error message
149
+ sourceIcons = { sourceIcons }
150
+ phoneTypeRenderer = { phoneTypeRenderer }
151
+ phoneSourceNameRenderer = { phoneSourceNameRenderer }
152
+ />
153
+ )
154
+ }
127
155
</ >
128
156
}
129
157
primaryTypographyProps = { {
0 commit comments