@@ -3,12 +3,14 @@ import PropTypes from 'prop-types';
33
44import ActiveCallDialPad from '../ActiveCallDialPad' ;
55import ActiveCallPanel from '../ActiveCallPanel' ;
6+ import FlipPanel from '../FlipPanel' ;
67
78class CallCtrlPanel extends Component {
89 constructor ( props ) {
910 super ( props ) ;
1011 this . state = {
1112 isShowKeyPad : false ,
13+ isShowFlipPanel : false ,
1214 } ;
1315
1416 this . hiddenKeyPad = ( ) => {
@@ -22,6 +24,18 @@ class CallCtrlPanel extends Component {
2224 isShowKeyPad : true ,
2325 } ) ;
2426 } ;
27+
28+ this . showFlipPanel = ( ) => {
29+ this . setState ( {
30+ isShowFlipPanel : true
31+ } ) ;
32+ } ;
33+
34+ this . hideFlipPanel = ( ) => {
35+ this . setState ( {
36+ isShowFlipPanel : false
37+ } ) ;
38+ } ;
2539 }
2640
2741 render ( ) {
@@ -35,6 +49,19 @@ class CallCtrlPanel extends Component {
3549 />
3650 ) ;
3751 }
52+ if ( this . state . isShowFlipPanel ) {
53+ return (
54+ < FlipPanel
55+ isOnFlip = { this . props . isOnFlip }
56+ flipNumbers = { this . props . flipNumbers }
57+ currentLocale = { this . props . currentLocale }
58+ formatPhone = { this . props . formatPhone }
59+ hideFlipPanel = { this . hideFlipPanel }
60+ flip = { this . props . flip }
61+ hangup = { this . props . hangup }
62+ />
63+ ) ;
64+ }
3865 return (
3966 < ActiveCallPanel
4067 backButtonLabel = { this . props . backButtonLabel }
@@ -66,6 +93,8 @@ class CallCtrlPanel extends Component {
6693 avatarUrl = { this . props . avatarUrl }
6794 brand = { this . props . brand }
6895 showContactDisplayPlaceholder = { this . props . showContactDisplayPlaceholder }
96+ onShowFlipPanel = { this . showFlipPanel }
97+ flipNumbers = { this . props . flipNumbers }
6998 >
7099 { this . props . children }
71100 </ ActiveCallPanel >
@@ -84,6 +113,8 @@ CallCtrlPanel.propTypes = {
84113 isOnMute : PropTypes . bool ,
85114 isOnHold : PropTypes . bool ,
86115 isOnRecord : PropTypes . bool ,
116+ isOnFlip : PropTypes . bool ,
117+ flipNumbers : PropTypes . array ,
87118 onMute : PropTypes . func . isRequired ,
88119 onUnmute : PropTypes . func . isRequired ,
89120 onHold : PropTypes . func . isRequired ,
@@ -92,6 +123,7 @@ CallCtrlPanel.propTypes = {
92123 onStopRecord : PropTypes . func . isRequired ,
93124 onAdd : PropTypes . func . isRequired ,
94125 hangup : PropTypes . func . isRequired ,
126+ flip : PropTypes . func . isRequired ,
95127 onBackButtonClick : PropTypes . func . isRequired ,
96128 onKeyPadChange : PropTypes . func . isRequired ,
97129 formatPhone : PropTypes . func . isRequired ,
@@ -111,6 +143,8 @@ CallCtrlPanel.defaultProps = {
111143 isOnMute : false ,
112144 isOnHold : false ,
113145 isOnRecord : false ,
146+ isOnFlip : false ,
147+ flipNumbers : [ ] ,
114148 phoneNumber : null ,
115149 children : undefined ,
116150 avatarUrl : null ,
0 commit comments