Added the two additiona states that don't yet exist on the backend, as faded and disabled options

This commit is contained in:
wmwragg 2016-07-27 12:25:44 +01:00
parent dab707a893
commit 074bbc7149
4 changed files with 49 additions and 13 deletions

View file

@ -65,19 +65,8 @@ module.exports = React.createClass({
}
},
_onToggle: function(ev) {
switch (ev.target.value) {
case "all":
this._save(false);
break;
case "mute":
this._save(true);
break;
}
if (this.props.onFinished) {
this.props.onFinished();
};
_onClickAlertMe: function() {
// Placeholder
},
_onClickAllNotifs: function() {
@ -87,6 +76,10 @@ module.exports = React.createClass({
};
},
_onClickMentions: function() {
// Placeholder
},
_onClickMute: function() {
this._save(true);
if (this.props.onFinished) {
@ -97,11 +90,21 @@ module.exports = React.createClass({
render: function() {
var cli = MatrixClientPeg.get();
var alertMeClasses = classNames({
'mx_NotificationStateContextMenu_field': true,
'mx_NotificationStateContextMenu_fieldDisabled': true,
});
var allNotifsClasses = classNames({
'mx_NotificationStateContextMenu_field': true,
'mx_NotificationStateContextMenu_fieldSet': !this.state.areNotifsMuted,
});
var mentionsClasses = classNames({
'mx_NotificationStateContextMenu_field': true,
'mx_NotificationStateContextMenu_fieldDisabled': true,
});
var muteNotifsClasses = classNames({
'mx_NotificationStateContextMenu_field': true,
'mx_NotificationStateContextMenu_fieldSet': this.state.areNotifsMuted,
@ -109,11 +112,19 @@ module.exports = React.createClass({
return (
<div>
<div className={ alertMeClasses } onClick={this._onClickAlertMe} >
<img src="img/icon-context-mute-off-copy.svg" width="15" height="10" />
Alert me
</div>
<div className={ allNotifsClasses } onClick={this._onClickAllNotifs} >
{ !this.state.areNotifsMuted ? "ON" : "OFF" }
<img src="img/icon-context-mute-off.svg" width="15" height="10" />
All notifications
</div>
<div className={ mentionsClasses } onClick={this._onClickMentions} >
<img src="img/icon-context-mute-mentions.svg" width="15" height="10" />
Mentions only
</div>
<div className={ muteNotifsClasses } onClick={this._onClickMute} >
{ this.state.areNotifsMuted ? "ON" : "OFF" }
<img src="img/icon-context-mute.svg" width="15" height="10" />