|
|
|
@ -3,11 +3,13 @@ |
|
|
|
|
import React, { Component } from 'react'; |
|
|
|
|
import { View } from 'react-native'; |
|
|
|
|
|
|
|
|
|
import { Container } from '../../../base/react'; |
|
|
|
|
import { ColorSchemeRegistry } from '../../../base/color-scheme'; |
|
|
|
|
import { CHAT_ENABLED, getFeatureFlag } from '../../../base/flags'; |
|
|
|
|
import { Container } from '../../../base/react'; |
|
|
|
|
import { connect } from '../../../base/redux'; |
|
|
|
|
import { StyleType } from '../../../base/styles'; |
|
|
|
|
import { ChatButton } from '../../../chat'; |
|
|
|
|
import { InfoDialogButton } from '../../../invite'; |
|
|
|
|
|
|
|
|
|
import { isToolboxVisible } from '../../functions'; |
|
|
|
|
import { HANGUP_BUTTON_SIZE } from '../../constants'; |
|
|
|
@ -41,6 +43,11 @@ const _BUTTON_SIZE_FACTOR = 0.85; |
|
|
|
|
*/ |
|
|
|
|
type Props = { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Whether the chat feature has been enabled. The meeting info button will be displayed in its place when disabled. |
|
|
|
|
*/ |
|
|
|
|
_chatEnabled: boolean, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The color-schemed stylesheet of the feature. |
|
|
|
|
*/ |
|
|
|
@ -202,7 +209,7 @@ class Toolbox extends Component<Props, State> { |
|
|
|
|
* @returns {React$Node} |
|
|
|
|
*/ |
|
|
|
|
_renderToolbar() { |
|
|
|
|
const { _styles } = this.props; |
|
|
|
|
const { _chatEnabled, _styles } = this.props; |
|
|
|
|
const buttonSize = this._calculateButtonSize(); |
|
|
|
|
let { buttonStyles, toggledButtonStyles } = _styles; |
|
|
|
|
|
|
|
|
@ -239,11 +246,20 @@ class Toolbox extends Component<Props, State> { |
|
|
|
|
<View |
|
|
|
|
pointerEvents = 'box-none' |
|
|
|
|
style = { styles.toolbar }> |
|
|
|
|
<ChatButton |
|
|
|
|
styles = { buttonStyles } |
|
|
|
|
toggledStyles = { |
|
|
|
|
this._getChatButtonToggledStyle(toggledButtonStyles) |
|
|
|
|
} /> |
|
|
|
|
{ |
|
|
|
|
_chatEnabled |
|
|
|
|
&& <ChatButton |
|
|
|
|
styles = { buttonStyles } |
|
|
|
|
toggledStyles = { |
|
|
|
|
this._getChatButtonToggledStyle(toggledButtonStyles) |
|
|
|
|
} /> |
|
|
|
|
} |
|
|
|
|
{ |
|
|
|
|
!_chatEnabled |
|
|
|
|
&& <InfoDialogButton |
|
|
|
|
styles = { buttonStyles } |
|
|
|
|
toggledStyles = { toggledButtonStyles } /> |
|
|
|
|
} |
|
|
|
|
<AudioMuteButton |
|
|
|
|
styles = { buttonStyles } |
|
|
|
|
toggledStyles = { toggledButtonStyles } /> |
|
|
|
@ -268,12 +284,14 @@ class Toolbox extends Component<Props, State> { |
|
|
|
|
* {@code Toolbox} props. |
|
|
|
|
* @private |
|
|
|
|
* @returns {{ |
|
|
|
|
* _chatEnabled: boolean, |
|
|
|
|
* _styles: StyleType, |
|
|
|
|
* _visible: boolean |
|
|
|
|
* }} |
|
|
|
|
*/ |
|
|
|
|
function _mapStateToProps(state: Object): Object { |
|
|
|
|
return { |
|
|
|
|
_chatEnabled: getFeatureFlag(state, CHAT_ENABLED, true), |
|
|
|
|
_styles: ColorSchemeRegistry.get(state, 'Toolbox'), |
|
|
|
|
_visible: isToolboxVisible(state) |
|
|
|
|
}; |
|
|
|
|