[RN] add support for inviting participants during a call on mobile

* Button conditionally shown based on if the feature is enabled and available
* Hooks for launching the invite UI (delegates to the native layer)
* Hooks for using the search and dial out checks from the native layer (calls back into JS)
* Hooks for handling sending invites and passing any failures back to the native layer
* Android and iOS handling for those hooks

Author: Ryan Peck <rpeck@atlassian.com>
Author: Eric Brynsvold <ebrynsvold@atlassian.com>
This commit is contained in:
Ryan Peck
2018-03-27 19:49:22 -05:00
committed by Saúl Ibarra Corretgé
parent 4e36127dc7
commit f64c13d4b7
24 changed files with 1559 additions and 185 deletions

View File

@@ -14,6 +14,11 @@ import {
isNarrowAspectRatio,
makeAspectRatioAware
} from '../../base/responsive-ui';
import {
InviteButton,
isAddPeopleEnabled,
isDialOutEnabled
} from '../../invite';
import {
EnterPictureInPictureToolbarButton
} from '../../mobile/picture-in-picture';
@@ -39,7 +44,7 @@ import { AudioMuteButton, HangupButton, VideoMuteButton } from './buttons';
* @private
* @type {boolean}
*/
const _SHARE_ROOM_TOOLBAR_BUTTON = true;
const _SHARE_ROOM_TOOLBAR_BUTTON = false;
/**
* The type of {@link Toolbox}'s React {@code Component} props.
@@ -56,6 +61,18 @@ type Props = {
*/
_audioOnly: boolean,
/**
* Whether or not the feature to directly invite people into the
* conference is available.
*/
_enableAddPeople: boolean,
/**
* Whether or not the feature to dial out to number to join the
* conference is available.
*/
_enableDialOut: boolean,
/**
* The indicator which determines whether the toolbox is enabled.
*/
@@ -212,9 +229,13 @@ class Toolbox extends Component<Props> {
const underlayColor = 'transparent';
const {
_audioOnly: audioOnly,
_enableAddPeople: enableAddPeople,
_enableDialOut: enableDialOut,
_videoMuted: videoMuted
} = this.props;
const showInviteButton = enableAddPeople || enableDialOut;
/* eslint-disable react/jsx-curly-spacing,react/jsx-handler-names */
return (
@@ -252,7 +273,7 @@ class Toolbox extends Component<Props> {
style = { style }
underlayColor = { underlayColor } />
{
_SHARE_ROOM_TOOLBAR_BUTTON
_SHARE_ROOM_TOOLBAR_BUTTON && !showInviteButton
&& <ToolbarButton
iconName = 'link'
iconStyle = { iconStyle }
@@ -260,6 +281,15 @@ class Toolbox extends Component<Props> {
style = { style }
underlayColor = { underlayColor } />
}
{
showInviteButton
&& <InviteButton
enableAddPeople = { enableAddPeople }
enableDialOut = { enableDialOut }
iconStyle = { iconStyle }
style = { style }
underlayColor = { underlayColor } />
}
<EnterPictureInPictureToolbarButton
iconStyle = { iconStyle }
style = { style }
@@ -388,6 +418,22 @@ function _mapStateToProps(state) {
*/
_audioOnly: Boolean(conference.audioOnly),
/**
* Whether or not the feature to directly invite people into the
* conference is available.
*
* @type {boolean}
*/
_enableAddPeople: isAddPeopleEnabled(state),
/**
* Whether or not the feature to dial out to number to join the
* conference is available.
*
* @type {boolean}
*/
_enableDialOut: isDialOutEnabled(state),
/**
* The indicator which determines whether the toolbox is enabled.
*