Fix mute buttons in participant list
parent
beab510f46
commit
6b469881ef
|
|
@ -6,6 +6,8 @@ import PropTypes from 'prop-types';
|
|||
import classnames from 'classnames';
|
||||
import * as appPropTypes from '../../appPropTypes';
|
||||
import { withRoomContext } from '../../../RoomContext';
|
||||
import { useIntl } from 'react-intl';
|
||||
import IconButton from '@material-ui/core/IconButton';
|
||||
import MicIcon from '@material-ui/icons/Mic';
|
||||
import MicOffIcon from '@material-ui/icons/MicOff';
|
||||
import ScreenIcon from '@material-ui/icons/ScreenShare';
|
||||
|
|
@ -128,6 +130,8 @@ const styles = (theme) =>
|
|||
|
||||
const ListPeer = (props) =>
|
||||
{
|
||||
const intl = useIntl();
|
||||
|
||||
const {
|
||||
roomClient,
|
||||
peer,
|
||||
|
|
@ -174,12 +178,13 @@ const ListPeer = (props) =>
|
|||
{children}
|
||||
<div className={classes.controls}>
|
||||
{ screenConsumer &&
|
||||
<div
|
||||
className={classnames(classes.button, 'screen', {
|
||||
on : screenVisible,
|
||||
off : !screenVisible,
|
||||
disabled : peer.peerScreenInProgress
|
||||
<IconButton
|
||||
aria-label={intl.formatMessage({
|
||||
id : 'tooltip.muteScreenSharing',
|
||||
defaultMessage : 'Mute participant share'
|
||||
})}
|
||||
color={ screenVisible ? 'primary' : 'secondary'}
|
||||
disabled={ peer.peerScreenInProgress }
|
||||
onClick={(e) =>
|
||||
{
|
||||
e.stopPropagation();
|
||||
|
|
@ -193,14 +198,15 @@ const ListPeer = (props) =>
|
|||
:
|
||||
<ScreenOffIcon />
|
||||
}
|
||||
</div>
|
||||
</IconButton>
|
||||
}
|
||||
<div
|
||||
className={classnames(classes.button, 'mic', {
|
||||
on : micEnabled,
|
||||
off : !micEnabled,
|
||||
disabled : peer.peerAudioInProgress
|
||||
<IconButton
|
||||
aria-label={intl.formatMessage({
|
||||
id : 'tooltip.muteParticipant',
|
||||
defaultMessage : 'Mute participant'
|
||||
})}
|
||||
color={ micEnabled ? 'primary' : 'secondary'}
|
||||
disabled={ peer.peerAudioInProgress }
|
||||
onClick={(e) =>
|
||||
{
|
||||
e.stopPropagation();
|
||||
|
|
@ -214,7 +220,7 @@ const ListPeer = (props) =>
|
|||
:
|
||||
<MicOffIcon />
|
||||
}
|
||||
</div>
|
||||
</IconButton>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
@ -232,15 +238,15 @@ ListPeer.propTypes =
|
|||
classes : PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
const makeMapStateToProps = (initialState, props) =>
|
||||
const makeMapStateToProps = (initialState, { id }) =>
|
||||
{
|
||||
const getPeerConsumers = makePeerConsumerSelector();
|
||||
|
||||
const mapStateToProps = (state) =>
|
||||
{
|
||||
return {
|
||||
peer : state.peers[props.id],
|
||||
...getPeerConsumers(state, props)
|
||||
peer : state.peers[id],
|
||||
...getPeerConsumers(state, id)
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue