11import React , { Component } from 'react' ;
22import PropTypes from 'prop-types' ;
33import classnames from 'classnames' ;
4- import Spinner from '../Spinner' ;
54import SlideMenu from '../SlideMenu' ;
5+ import EntityButton from '../EntityButton' ;
66import EntityModal from '../EntityModal' ;
77import Button from '../Button' ;
88import LogButton from '../LogButton' ;
@@ -24,7 +24,7 @@ function ClickToDialButton({
2424 disabled = { disableLinks || disableClickToDial || ! phoneNumber } >
2525 < span
2626 className = { dynamicsFont . call }
27- title = { title } />
27+ title = { title } />
2828 </ Button >
2929 ) ;
3030}
@@ -34,13 +34,15 @@ ClickToDialButton.propTypes = {
3434 disableLinks : PropTypes . bool ,
3535 disableClickToDial : PropTypes . bool ,
3636 phoneNumber : PropTypes . string ,
37+ title : PropTypes . string ,
3738} ;
3839ClickToDialButton . defaultProps = {
3940 className : undefined ,
4041 onClickToDial : undefined ,
4142 disableLinks : false ,
4243 disableClickToDial : false ,
4344 phoneNumber : undefined ,
45+ title : undefined ,
4446} ;
4547
4648function ClickToSmsButton ( {
@@ -74,59 +76,6 @@ ClickToSmsButton.defaultProps = {
7476 phoneNumber : undefined ,
7577} ;
7678
77- function EntityButton ( {
78- className,
79- onViewEntity,
80- onCreateEntity,
81- hasEntity,
82- isCreating,
83- disableLinks,
84- viewEntityTitle,
85- createEntityTitle,
86- } ) {
87- // console.debug('isCreating', isCreating);
88- const spinner = isCreating ?
89- (
90- < div className = { styles . spinnerContainer } >
91- < Spinner ringWidth = { 2 } />
92- </ div >
93- ) :
94- null ;
95- const icon = hasEntity ? dynamicsFont . record : dynamicsFont . addEntity ;
96- const onClick = hasEntity ? onViewEntity : onCreateEntity ;
97- const title = hasEntity ? viewEntityTitle : createEntityTitle ;
98- return (
99- < Button
100- className = { classnames ( styles . entity , className ) }
101- onClick = { onClick }
102- disabled = { disableLinks } >
103-
104- < span
105- className = { icon }
106- title = { title }
107- />
108- { spinner }
109- </ Button >
110- ) ;
111- }
112- EntityButton . propTypes = {
113- className : PropTypes . string ,
114- onViewEntity : PropTypes . func ,
115- onCreateEntity : PropTypes . func ,
116- hasEntity : PropTypes . bool ,
117- isCreating : PropTypes . bool ,
118- disableLinks : PropTypes . bool ,
119- } ;
120- EntityButton . defaultProps = {
121- className : undefined ,
122- onViewEntity : undefined ,
123- hasEntity : false ,
124- onCreateEntity : undefined ,
125- isCreating : false ,
126- disableLinks : false ,
127- } ;
128-
129-
13079export default class ActionMenu extends Component {
13180 constructor ( props ) {
13281 super ( props ) ;
@@ -176,7 +125,6 @@ export default class ActionMenu extends Component {
176125 phoneNumber,
177126 disableLinks,
178127 disableClickToDial,
179- stopPropagation,
180128 addLogTitle,
181129 editLogTitle,
182130 callTitle,
@@ -203,15 +151,15 @@ export default class ActionMenu extends Component {
203151 let entityButton ;
204152 if ( hasEntity && onViewEntity ) {
205153 entityButton = ( < EntityButton
206- className = { styles . baseGroup }
154+ className = { classnames ( styles . entity , styles . baseGroup ) }
207155 onViewEntity = { onViewEntity }
208156 hasEntity = { hasEntity }
209157 disableLinks = { disableLinks }
210158 viewEntityTitle = { viewEntityTitle }
211159 /> ) ;
212160 } else if ( ! hasEntity && phoneNumber && onCreateEntity ) {
213161 entityButton = ( < EntityButton
214- className = { styles . baseGroup }
162+ className = { classnames ( styles . entity , styles . baseGroup ) }
215163 onCreateEntity = { this . openEntityModal }
216164 hasEntity = { hasEntity }
217165 disableLinks = { disableLinks }
@@ -318,7 +266,6 @@ ActionMenu.propTypes = {
318266 disableLinks : PropTypes . bool ,
319267 disableClickToDial : PropTypes . bool ,
320268 stopPropagation : PropTypes . bool ,
321- captureClick : PropTypes . bool ,
322269 addLogTitle : PropTypes . string ,
323270 editLogTitle : PropTypes . string ,
324271 textTitle : PropTypes . string ,
@@ -342,7 +289,6 @@ ActionMenu.defaultProps = {
342289 disableLinks : false ,
343290 disableClickToDial : false ,
344291 stopPropagation : false ,
345- captureClick : false ,
346292 addLogTitle : undefined ,
347293 editLogTitle : undefined ,
348294 textTitle : undefined ,
0 commit comments