From 424c367ecc7c2b7f607d5d973056365591a7aac6 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 6 Feb 2018 18:45:43 +0000 Subject: [PATCH 1/4] Fix the reject/accept call buttons in canary (mk2) Fixes https://github.com/vector-im/riot-web/issues/6081 by making the accept/reject buttons AccessibleButtons which they should be anyway (presumably the role=button makes chrome do the right thing with the events). Also swallow the onClick event otherwise that propagates out to the room header and causes it to expand/collapse. --- src/components/views/voip/IncomingCallBox.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/views/voip/IncomingCallBox.js b/src/components/views/voip/IncomingCallBox.js index 8d75029baa..c0dff4e8a3 100644 --- a/src/components/views/voip/IncomingCallBox.js +++ b/src/components/views/voip/IncomingCallBox.js @@ -1,5 +1,6 @@ /* Copyright 2015, 2016 OpenMarket Ltd +Copyright 2018 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,6 +19,7 @@ import PropTypes from 'prop-types'; import MatrixClientPeg from '../../../MatrixClientPeg'; import dis from '../../../dispatcher'; import { _t } from '../../../languageHandler'; +import AccessibleButton from '../elements/AccessibleButton'; module.exports = React.createClass({ displayName: 'IncomingCallBox', @@ -26,14 +28,16 @@ module.exports = React.createClass({ incomingCall: PropTypes.object, }, - onAnswerClick: function() { + onAnswerClick: function(e) { + e.stopPropagation(); dis.dispatch({ action: 'answer', room_id: this.props.incomingCall.roomId, }); }, - onRejectClick: function() { + onRejectClick: function(e) { + e.stopPropagation(); dis.dispatch({ action: 'hangup', room_id: this.props.incomingCall.roomId, @@ -67,14 +71,14 @@ module.exports = React.createClass({
-
+ { _t("Decline") } -
+
-
+ { _t("Accept") } -
+
From 0a5bf079139dedb3cc3b897ea68513a7ab146487 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 7 Feb 2018 10:13:19 +0000 Subject: [PATCH 2/4] Use getComponent --- src/components/views/voip/IncomingCallBox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/voip/IncomingCallBox.js b/src/components/views/voip/IncomingCallBox.js index c0dff4e8a3..a04cf4421e 100644 --- a/src/components/views/voip/IncomingCallBox.js +++ b/src/components/views/voip/IncomingCallBox.js @@ -19,7 +19,6 @@ import PropTypes from 'prop-types'; import MatrixClientPeg from '../../../MatrixClientPeg'; import dis from '../../../dispatcher'; import { _t } from '../../../languageHandler'; -import AccessibleButton from '../elements/AccessibleButton'; module.exports = React.createClass({ displayName: 'IncomingCallBox', @@ -63,6 +62,7 @@ module.exports = React.createClass({ } } + const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); return (
From 2a68e3ea392f84ef11b1efb0b5d58a2dd837bc92 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 7 Feb 2018 11:42:50 +0000 Subject: [PATCH 3/4] import sdk --- src/components/views/voip/IncomingCallBox.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/views/voip/IncomingCallBox.js b/src/components/views/voip/IncomingCallBox.js index a04cf4421e..ae003ff6f3 100644 --- a/src/components/views/voip/IncomingCallBox.js +++ b/src/components/views/voip/IncomingCallBox.js @@ -19,6 +19,7 @@ import PropTypes from 'prop-types'; import MatrixClientPeg from '../../../MatrixClientPeg'; import dis from '../../../dispatcher'; import { _t } from '../../../languageHandler'; +import sdk from '../../../index' module.exports = React.createClass({ displayName: 'IncomingCallBox', From 8eb4137ec315293b546a0ec305e76774c16e0ae3 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 7 Feb 2018 11:51:41 +0000 Subject: [PATCH 4/4] missing semicolon --- src/components/views/voip/IncomingCallBox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/voip/IncomingCallBox.js b/src/components/views/voip/IncomingCallBox.js index ae003ff6f3..6cbaabe602 100644 --- a/src/components/views/voip/IncomingCallBox.js +++ b/src/components/views/voip/IncomingCallBox.js @@ -19,7 +19,7 @@ import PropTypes from 'prop-types'; import MatrixClientPeg from '../../../MatrixClientPeg'; import dis from '../../../dispatcher'; import { _t } from '../../../languageHandler'; -import sdk from '../../../index' +import sdk from '../../../index'; module.exports = React.createClass({ displayName: 'IncomingCallBox',