mirror of https://github.com/jitsi/jitsi-meet
Audio only mode will be toggleable only from the VideoStatusLabel, so remove AudioOnlyButton from the toolbar and delete the component itself. As a result of the button being removed, a truthy check in VideoStatusLabel was also removed to ensure it will display as it is now the only way to toggle audio only mode. Also set the cursor on VideoStatusLabel to always be default, so it can never show the text cursor.pull/1585/head jitsi-meet_2092
parent
bf163d221c
commit
a1476c68f1
@ -1,103 +0,0 @@ |
||||
import React, { Component } from 'react'; |
||||
import { connect } from 'react-redux'; |
||||
|
||||
import { toggleAudioOnly } from '../../base/conference'; |
||||
|
||||
import ToolbarButton from './ToolbarButton'; |
||||
|
||||
/** |
||||
* React {@code Component} for toggling audio only mode. |
||||
* |
||||
* @extends Component |
||||
*/ |
||||
class AudioOnlyButton extends Component { |
||||
/** |
||||
* {@code AudioOnlyButton}'s property types. |
||||
* |
||||
* @static |
||||
*/ |
||||
static propTypes = { |
||||
/** |
||||
* Whether or not audio only mode is enabled. |
||||
*/ |
||||
_audioOnly: React.PropTypes.bool, |
||||
|
||||
/** |
||||
* Invoked to toggle audio only mode. |
||||
*/ |
||||
dispatch: React.PropTypes.func, |
||||
|
||||
/** |
||||
* From which side the button tooltip should appear. |
||||
*/ |
||||
tooltipPosition: React.PropTypes.string |
||||
} |
||||
|
||||
/** |
||||
* Initializes a new {@code AudioOnlyButton} instance. |
||||
* |
||||
* @param {Object} props - The read-only properties with which the new |
||||
* instance is to be initialized. |
||||
*/ |
||||
constructor(props) { |
||||
super(props); |
||||
|
||||
// Bind event handlers so they are only bound once for every instance.
|
||||
this._onClick = this._onClick.bind(this); |
||||
} |
||||
|
||||
/** |
||||
* Implements React's {@link Component#render()}. |
||||
* |
||||
* @inheritdoc |
||||
* @returns {ReactElement} |
||||
*/ |
||||
render() { |
||||
const buttonConfiguration = { |
||||
buttonName: 'audioonly', |
||||
classNames: [ 'button', 'icon-visibility' ], |
||||
enabled: true, |
||||
id: 'toolbar_button_audioonly', |
||||
tooltipKey: 'toolbar.audioonly' |
||||
}; |
||||
|
||||
if (this.props._audioOnly) { |
||||
buttonConfiguration.classNames.push('toggled button-active'); |
||||
} |
||||
|
||||
return ( |
||||
<ToolbarButton |
||||
button = { buttonConfiguration } |
||||
onClick = { this._onClick } |
||||
tooltipPosition = { this.props.tooltipPosition } /> |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* Dispatches an action to toggle audio only mode. |
||||
* |
||||
* @private |
||||
* @returns {void} |
||||
*/ |
||||
_onClick() { |
||||
this.props.dispatch(toggleAudioOnly()); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Maps (parts of) the Redux state to the associated {@code AudioOnlyButton}'s |
||||
* props. |
||||
* |
||||
* @param {Object} state - The Redux state. |
||||
* @private |
||||
* @returns {{ |
||||
* _audioOnly: boolean |
||||
* }} |
||||
*/ |
||||
function _mapStateToProps(state) { |
||||
return { |
||||
_audioOnly: state['features/base/conference'].audioOnly |
||||
}; |
||||
} |
||||
|
||||
export default connect(_mapStateToProps)(AudioOnlyButton); |
@ -1,2 +1 @@ |
||||
export { default as AudioOnlyButton } from './AudioOnlyButton'; |
||||
export { default as Toolbox } from './Toolbox'; |
||||
|
Loading…
Reference in new issue