ensl_gathers/lib/react/sound.jsx

33 lines
601 B
React
Raw Normal View History

2015-08-27 16:54:34 +00:00
var SoundPanel = React.createClass({
mute() {
2015-10-02 14:53:11 +00:00
this.props.soundController.mute();
2015-08-27 16:54:34 +00:00
this.forceUpdate();
},
unMute() {
2015-10-02 14:53:11 +00:00
this.props.soundController.unMute();
2015-08-27 16:54:34 +00:00
this.forceUpdate();
},
render() {
2015-10-02 14:53:11 +00:00
let soundController = this.props.soundController;
2015-08-27 16:54:34 +00:00
if (soundController.isMuted) {
return (
<li>
<a href="#" onClick={this.unMute}>
2015-09-17 11:40:11 +00:00
Muted&nbsp;<i className="fa fa-volume-off fa-fw"></i>
2015-08-27 16:54:34 +00:00
</a>
</li>
);
} else {
return (
<li>
<a href="#" onClick={this.mute}>
2015-09-17 11:40:11 +00:00
Unmuted&nbsp;<i className="fa fa-volume-up fa-fw"></i>
2015-08-27 16:54:34 +00:00
</a>
</li>
);
}
}
2015-10-02 14:53:11 +00:00
});