From 607f7fe145290a1d1b5ff4327602f29b97e1e2c1 Mon Sep 17 00:00:00 2001 From: embbnux Date: Thu, 3 Aug 2017 09:27:55 +0800 Subject: [PATCH 1/8] svg button --- src/components/ActiveCallButton/index.js | 38 ++++++++++++--------- src/components/CircleButton/index.js | 43 +++++++++++++++--------- src/containers/CallCtrlPage/index.js | 6 ++-- 3 files changed, 53 insertions(+), 34 deletions(-) diff --git a/src/components/ActiveCallButton/index.js b/src/components/ActiveCallButton/index.js index 60e0dc5f4c..0f10072281 100644 --- a/src/components/ActiveCallButton/index.js +++ b/src/components/ActiveCallButton/index.js @@ -6,7 +6,7 @@ import CircleButton from '../CircleButton'; import styles from './styles.scss'; export default function ActiveCallButton(props) { - const className = classnames(styles.root, props.className); + const className = classnames(styles.btnSvg, props.className); const buttonClassName = classnames( styles.button, props.buttonClassName, @@ -14,21 +14,29 @@ export default function ActiveCallButton(props) { props.disabled ? styles.buttonDisabled : null, ); return ( -
-
- -
-
+ + + {props.title} -
-
+ + ); } diff --git a/src/components/CircleButton/index.js b/src/components/CircleButton/index.js index 8b79ec90bb..0bc6c443cb 100644 --- a/src/components/CircleButton/index.js +++ b/src/components/CircleButton/index.js @@ -25,24 +25,27 @@ function CircleButton(props) { props.showBorder ? null : styles.noBorder ); return ( -
- - - - {icon} - - -
+ + + {icon} + + ); } @@ -52,6 +55,10 @@ CircleButton.propTypes = { showBorder: PropTypes.bool, iconClassName: PropTypes.string, onClick: PropTypes.func, + width: PropTypes.number, + height: PropTypes.number, + x: PropTypes.number, + y: PropTypes.number, }; CircleButton.defaultProps = { @@ -60,6 +67,10 @@ CircleButton.defaultProps = { showBorder: true, iconClassName: undefined, onClick: () => null, + width: 500, + height: 500, + x: 0, + y: 0, }; export default CircleButton; diff --git a/src/containers/CallCtrlPage/index.js b/src/containers/CallCtrlPage/index.js index 4a1da26fd2..8e7b6da2ab 100644 --- a/src/containers/CallCtrlPage/index.js +++ b/src/containers/CallCtrlPage/index.js @@ -92,9 +92,9 @@ class CallCtrlPage extends Component { render() { const session = this.props.session; - if (!session.id) { - return null; - } + // if (!session.id) { + // return null; + // } const phoneNumber = session.direction === callDirections.outbound ? session.to : session.from; let fallbackUserName; From 9c550fb361c2a72778b37892eec6175a04e9546c Mon Sep 17 00:00:00 2001 From: embbnux Date: Thu, 3 Aug 2017 16:12:34 +0800 Subject: [PATCH 2/8] adjust call button ui --- src/components/ActiveCallButton/index.js | 32 +++++++++++++++------ src/components/ActiveCallButton/styles.scss | 6 +--- src/components/ActiveCallPad/styles.scss | 4 ++- src/components/CircleButton/index.js | 4 +-- src/components/CircleButton/styles.scss | 3 -- 5 files changed, 29 insertions(+), 20 deletions(-) diff --git a/src/components/ActiveCallButton/index.js b/src/components/ActiveCallButton/index.js index 0f10072281..4549448c57 100644 --- a/src/components/ActiveCallButton/index.js +++ b/src/components/ActiveCallButton/index.js @@ -14,12 +14,19 @@ export default function ActiveCallButton(props) { props.disabled ? styles.buttonDisabled : null, ); return ( - + {props.title} @@ -49,6 +55,10 @@ ActiveCallButton.propTypes = { title: PropTypes.string.isRequired, icon: PropTypes.func, showBorder: PropTypes.bool, + width: PropTypes.number, + height: PropTypes.number, + x: PropTypes.number, + y: PropTypes.number, }; ActiveCallButton.defaultProps = { @@ -58,4 +68,8 @@ ActiveCallButton.defaultProps = { active: false, icon: undefined, showBorder: true, + width: '100%', + height: '100%', + x: 0, + y: 0, }; diff --git a/src/components/ActiveCallButton/styles.scss b/src/components/ActiveCallButton/styles.scss index e76ae81fb3..e9b7bf3bc9 100644 --- a/src/components/ActiveCallButton/styles.scss +++ b/src/components/ActiveCallButton/styles.scss @@ -27,11 +27,7 @@ $title-height: 24px; .buttonTitle { @include secondary-font; - font-size: 12px; - text-align: center; - width: 100%; - line-height: $title-height; - height: $title-height; + font-size: 73px; } .buttonActive { diff --git a/src/components/ActiveCallPad/styles.scss b/src/components/ActiveCallPad/styles.scss index c3b8d3a7fe..f9d829e30e 100644 --- a/src/components/ActiveCallPad/styles.scss +++ b/src/components/ActiveCallPad/styles.scss @@ -27,7 +27,9 @@ } .stopButton { - background: #ff4646; + circle { + fill: #ff4646; + } g, path { fill: #ffffff; } diff --git a/src/components/CircleButton/index.js b/src/components/CircleButton/index.js index 0bc6c443cb..4504738839 100644 --- a/src/components/CircleButton/index.js +++ b/src/components/CircleButton/index.js @@ -67,8 +67,8 @@ CircleButton.defaultProps = { showBorder: true, iconClassName: undefined, onClick: () => null, - width: 500, - height: 500, + width: '100%', + height: '100%', x: 0, y: 0, }; diff --git a/src/components/CircleButton/styles.scss b/src/components/CircleButton/styles.scss index b65f44a7ba..5d5097d51b 100644 --- a/src/components/CircleButton/styles.scss +++ b/src/components/CircleButton/styles.scss @@ -9,9 +9,6 @@ } .btnSvg { - position: absolute; - top: 0; - left: 0; width: 100%; } From c2cb8aba952a245829c78a2973fed0256a150dd1 Mon Sep 17 00:00:00 2001 From: embbnux Date: Thu, 3 Aug 2017 17:22:15 +0800 Subject: [PATCH 3/8] fix bug of buttons --- src/components/Environment/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Environment/index.js b/src/components/Environment/index.js index c471932109..a3831cb433 100644 --- a/src/components/Environment/index.js +++ b/src/components/Environment/index.js @@ -99,7 +99,10 @@ class Environment extends Component {
Environment + buttons={[]} + > + Environment + Server From 06e86527d4cb55f4d691891677ec4e61ecf9b6b1 Mon Sep 17 00:00:00 2001 From: embbnux Date: Thu, 3 Aug 2017 17:30:17 +0800 Subject: [PATCH 4/8] change loading condition --- src/containers/DialerPage/index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/containers/DialerPage/index.js b/src/containers/DialerPage/index.js index 5773f5b190..8d79a3e340 100644 --- a/src/containers/DialerPage/index.js +++ b/src/containers/DialerPage/index.js @@ -37,9 +37,6 @@ function mapToProps(_, { fromNumber: callingSettings.fromNumber, showSpinner: !( call.ready && - callingSettings.ready && - locale.ready && - connectivityMonitor.ready && (!isWebphoneMode || !webphone || !waitingWebphoneConnected) ), }; From 96b0837a1552b31a166bf14ce1eb864fa8e29c0c Mon Sep 17 00:00:00 2001 From: embbnux Date: Thu, 3 Aug 2017 17:33:02 +0800 Subject: [PATCH 5/8] fix error comment --- src/containers/CallCtrlPage/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/containers/CallCtrlPage/index.js b/src/containers/CallCtrlPage/index.js index e130ab81b2..48a855479e 100644 --- a/src/containers/CallCtrlPage/index.js +++ b/src/containers/CallCtrlPage/index.js @@ -95,9 +95,9 @@ class CallCtrlPage extends Component { render() { const session = this.props.session; - // if (!session.id) { - // return null; - // } + if (!session.id) { + return null; + } const phoneNumber = session.direction === callDirections.outbound ? session.to : session.from; let fallbackUserName; From a4468c9ebed43016b21b12d6afdba535e15676f7 Mon Sep 17 00:00:00 2001 From: embbnux Date: Fri, 4 Aug 2017 09:53:47 +0800 Subject: [PATCH 6/8] fix docs error --- docs/src/app/pages/Components/ActiveCallPad/Demo.js | 4 +++- docs/src/app/pages/Components/ActiveCallPanel/Demo.js | 3 +++ src/components/ActiveCallPanel/index.js | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/src/app/pages/Components/ActiveCallPad/Demo.js b/docs/src/app/pages/Components/ActiveCallPad/Demo.js index 21474bea78..31209a43fe 100644 --- a/docs/src/app/pages/Components/ActiveCallPad/Demo.js +++ b/docs/src/app/pages/Components/ActiveCallPad/Demo.js @@ -13,7 +13,9 @@ props.hangup = () => null; props.onShowKeyPad = () => null; props.onAdd = () => null; props.currentLocale = 'en-US'; - +props.flipNumbers = []; +props.recordStatus = 'recordStatus-idle'; +props.onShowFlipPanel = () => null; /** * A example of `ActiveCallPad` */ diff --git a/docs/src/app/pages/Components/ActiveCallPanel/Demo.js b/docs/src/app/pages/Components/ActiveCallPanel/Demo.js index 5267fd34d2..ad2b40b9f0 100644 --- a/docs/src/app/pages/Components/ActiveCallPanel/Demo.js +++ b/docs/src/app/pages/Components/ActiveCallPanel/Demo.js @@ -23,6 +23,9 @@ props.nameMatches = []; props.onSelectMatcherName = () => null; props.selectedMatcherIndex = 0; props.fallBackName = 'Unknown'; +props.flipNumbers = []; +props.recordStatus = 'recordStatus-idle'; +props.onShowKeyPad = () => null; /** * A example of `ActiveCallPanel` */ diff --git a/src/components/ActiveCallPanel/index.js b/src/components/ActiveCallPanel/index.js index 8052a08f6f..0ad09695b4 100644 --- a/src/components/ActiveCallPanel/index.js +++ b/src/components/ActiveCallPanel/index.js @@ -197,15 +197,14 @@ ActiveCallPanel.propTypes = { backButtonLabel: PropTypes.string, brand: PropTypes.string, showContactDisplayPlaceholder: PropTypes.bool, - onShowFlipPanel: PropTypes.func.isRequired, - flipNumbers: PropTypes.array.isRequired, + onShowFlipPanel: PropTypes.func, + flipNumbers: PropTypes.array, }; ActiveCallPanel.defaultProps = { startTime: null, isOnMute: false, isOnHold: false, - isOnRecord: false, phoneNumber: null, children: undefined, avatarUrl: null, @@ -213,6 +212,7 @@ ActiveCallPanel.defaultProps = { brand: 'RingCentral', showContactDisplayPlaceholder: true, flipNumbers: [], + onShowFlipPanel: () => null, }; export default ActiveCallPanel; From ac3d445f8ef1769874c776b31127be08f85cda38 Mon Sep 17 00:00:00 2001 From: embbnux Date: Fri, 4 Aug 2017 10:28:16 +0800 Subject: [PATCH 7/8] fix typo --- docs/src/www/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/www/index.html b/docs/src/www/index.html index d0d5eab0b8..000eb67330 100644 --- a/docs/src/www/index.html +++ b/docs/src/www/index.html @@ -4,7 +4,7 @@ - RingCentral Js Widget + RingCentral JS Widget From d427f053570d877690de72e8de82eef08814f45c Mon Sep 17 00:00:00 2001 From: embbnux Date: Fri, 4 Aug 2017 14:59:47 +0800 Subject: [PATCH 8/8] adjust showSpinner --- src/containers/DialerPage/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/containers/DialerPage/index.js b/src/containers/DialerPage/index.js index 8d79a3e340..5773f5b190 100644 --- a/src/containers/DialerPage/index.js +++ b/src/containers/DialerPage/index.js @@ -37,6 +37,9 @@ function mapToProps(_, { fromNumber: callingSettings.fromNumber, showSpinner: !( call.ready && + callingSettings.ready && + locale.ready && + connectivityMonitor.ready && (!isWebphoneMode || !webphone || !waitingWebphoneConnected) ), };