Merge pull request #3611 from KDSBrowne/MuteButton-Voice-Inidicator

Mute button glow indicator
This commit is contained in:
Anton Georgiev 2017-02-02 12:06:49 -05:00 committed by GitHub
commit 10b0cfe893
5 changed files with 13 additions and 2 deletions

View File

@ -5,12 +5,16 @@ import styles from '../styles.scss';
export default class MuteAudio extends React.Component {
render() {
const { isInAudio, isMuted, callback } = this.props;
const { isInAudio, isMuted, callback, isTalking} = this.props;
let label = !isMuted ? 'Mute' : 'Unmute';
let icon = !isMuted ? 'audio-off' : 'audio';
let className = !isInAudio ? styles.invisible : null;
let tabIndex = !isInAudio ? -1 : 0;
if (isInAudio && isTalking) {
className = styles.circleGlow;
}
return (
<Button
onClick={callback}

View File

@ -19,6 +19,8 @@ export default createContainer((params) => {
const user = Users.findOne({ userId: userId }).user;
const isMuted = user.voiceUser.muted;
const isInAudio = user.voiceUser.joined;
const isTalking = user.voiceUser.talking;
let callback = () => {};
if (isInAudio && !isMuted) {
@ -33,6 +35,7 @@ export default createContainer((params) => {
isInAudio,
isMuted,
callback,
isTalking,
};
return data;
}, MuteAudioContainer);

View File

@ -30,3 +30,7 @@
.invisible {
visibility: hidden;
}
.circleGlow > :first-child{
box-shadow: 0 0 .15rem #FFF !important;
}

View File

@ -95,6 +95,7 @@ export default class Button extends BaseButton {
} = this.props;
let propClassNames = {};
propClassNames[styles.button] = true;
propClassNames[styles[size]] = true;
propClassNames[styles[color]] = true;

View File

@ -259,7 +259,6 @@ $btn-jumbo-padding: $jumbo-padding-y $jumbo-padding-x;
}
}
.circle {
$btn-sm-padding-x: nth($btn-sm-padding, 2) / 2.75;
$btn-md-padding-x: nth($btn-md-padding, 2) / 2.75;