@@ -7,7 +7,7 @@ import Panel from '../Panel';
77import DurationCounter from '../DurationCounter' ;
88import ActiveCallPad from '../ActiveCallPad' ;
99import ActiveCallDialPad from '../ActiveCallDialPad' ;
10-
10+ import ContactDisplay from '../ContactDisplay' ;
1111import dynamicsFont from '../../assets/DynamicsFont/DynamicsFont.scss' ;
1212import styles from './styles.scss' ;
1313
@@ -19,17 +19,38 @@ function CallInfo(props) {
1919 < DurationCounter startTime = { props . startTime } />
2020 </ span >
2121 ) : null ;
22+ let avatar ;
23+ if ( props . avatarUrl ) {
24+ avatar = ( < img src = { props . avatarUrl } alt = "avatar" /> ) ;
25+ } else {
26+ avatar = ( < i className = { classnames ( dynamicsFont . portrait , styles . icon ) } /> ) ;
27+ }
2228 return (
2329 < div className = { styles . userInfo } >
2430 < div className = { styles . avatarContainer } >
2531 < div className = { styles . avatar } >
26- < i className = { classnames ( dynamicsFont . portrait , styles . icon ) } />
32+ { avatar }
2733 </ div >
2834 </ div >
2935 < div className = { styles . infoContent } >
3036 < div className = { styles . userName } >
31- { props . name }
32- { timeCounter }
37+ < ContactDisplay
38+ className = { styles . contactDisplay }
39+ contactMatches = { props . nameMatches }
40+ phoneNumber = { props . phoneNumber }
41+ fallBackName = { props . fallBackName }
42+ currentLocale = { props . currentLocale }
43+ areaCode = { props . areaCode }
44+ countryCode = { props . countryCode }
45+ selectClassName = { styles . contactNameSelect }
46+ showType = { false }
47+ disabled = { false }
48+ selected = { props . selectedMatcherIndex }
49+ onSelectContact = { props . onSelectMatcherName }
50+ isLogging = { false }
51+ enableContactFallback
52+ />
53+ { timeCounter }
3354 </ div >
3455 < div className = { styles . userPhoneNumber } >
3556 { props . formatPhone ( props . phoneNumber ) }
@@ -40,15 +61,23 @@ function CallInfo(props) {
4061}
4162
4263CallInfo . propTypes = {
43- name : PropTypes . string . isRequired ,
4464 phoneNumber : PropTypes . string ,
4565 formatPhone : PropTypes . func . isRequired ,
4666 startTime : PropTypes . number ,
67+ nameMatches : PropTypes . array . isRequired ,
68+ fallBackName : PropTypes . string . isRequired ,
69+ areaCode : PropTypes . string . isRequired ,
70+ countryCode : PropTypes . string . isRequired ,
71+ currentLocale : PropTypes . string . isRequired ,
72+ selectedMatcherIndex : PropTypes . number . isRequired ,
73+ onSelectMatcherName : PropTypes . func . isRequired ,
74+ avatarUrl : PropTypes . string ,
4775} ;
4876
4977CallInfo . defaultProps = {
5078 phoneNumber : null ,
5179 startTime : null ,
80+ avatarUrl : null ,
5281} ;
5382
5483class ActiveCallPanel extends Component {
@@ -74,10 +103,17 @@ class ActiveCallPanel extends Component {
74103 render ( ) {
75104 const userInfo = this . state . isShowKeyPad ? null : (
76105 < CallInfo
77- name = { this . props . userName }
106+ currentLocale = { this . props . currentLocale }
107+ nameMatches = { this . props . nameMatches }
108+ fallBackName = { this . props . fallBackName }
78109 phoneNumber = { this . props . phoneNumber }
79110 formatPhone = { this . props . formatPhone }
80111 startTime = { this . props . startTime }
112+ areaCode = { this . props . areaCode }
113+ countryCode = { this . props . countryCode }
114+ selectedMatcherIndex = { this . props . selectedMatcherIndex }
115+ onSelectMatcherName = { this . props . onSelectMatcherName }
116+ avatarUrl = { this . props . avatarUrl }
81117 />
82118 ) ;
83119 const buttonsPad = this . state . isShowKeyPad ? null : (
@@ -130,7 +166,8 @@ class ActiveCallPanel extends Component {
130166
131167ActiveCallPanel . propTypes = {
132168 phoneNumber : PropTypes . string ,
133- userName : PropTypes . string ,
169+ nameMatches : PropTypes . array . isRequired ,
170+ fallBackName : PropTypes . string . isRequired ,
134171 currentLocale : PropTypes . string . isRequired ,
135172 startTime : PropTypes . number ,
136173 isOnMute : PropTypes . bool ,
@@ -148,6 +185,11 @@ ActiveCallPanel.propTypes = {
148185 onKeyPadChange : PropTypes . func . isRequired ,
149186 formatPhone : PropTypes . func . isRequired ,
150187 children : PropTypes . node ,
188+ areaCode : PropTypes . string . isRequired ,
189+ countryCode : PropTypes . string . isRequired ,
190+ selectedMatcherIndex : PropTypes . number . isRequired ,
191+ onSelectMatcherName : PropTypes . func . isRequired ,
192+ avatarUrl : PropTypes . string ,
151193} ;
152194
153195ActiveCallPanel . defaultProps = {
@@ -158,6 +200,7 @@ ActiveCallPanel.defaultProps = {
158200 isOnRecord : false ,
159201 phoneNumber : null ,
160202 children : undefined ,
203+ avatarUrl : null ,
161204} ;
162205
163206export default ActiveCallPanel ;
0 commit comments