Skip to content

Commit

Permalink
[RN] Toggle audio-only icon based on state
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul authored and lyubomir committed Jul 6, 2017
1 parent 46a87e4 commit f878f54
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion react/features/toolbox/components/Toolbox.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class Toolbox extends Component {
*/
_audioMuted: React.PropTypes.bool,

/**
* Flag showing whether the audio-only mode is in use.
*/
_audioOnly: React.PropTypes.bool,

/**
* Flag showing whether room is locked.
*/
Expand Down Expand Up @@ -207,7 +212,9 @@ class Toolbox extends Component {
style = { style }
underlayColor = { underlayColor } />
<ToolbarButton
iconName = 'visibility'
iconName = {
this.props._audioOnly ? 'visibility-off' : 'visibility'
}
iconStyle = { iconStyle }
onClick = { this.props._onToggleAudioOnly }
style = { style }
Expand Down Expand Up @@ -305,6 +312,7 @@ function _mapDispatchToProps(dispatch) {
*
* @param {Object} state - Redux store.
* @returns {{
* _audioOnly: boolean,
* _locked: boolean
* }}
* @private
Expand All @@ -315,6 +323,15 @@ function _mapStateToProps(state) {
return {
...abstractMapStateToProps(state),

/**
* The indicator which determines whether the conference is in
* audio-only mode.
*
* @protected
* @type {boolean}
*/
_audioOnly: Boolean(conference.audioOnly),

/**
* The indicator which determines whether the conference is
* locked/password-protected.
Expand Down

0 comments on commit f878f54

Please sign in to comment.