Settings button in Room Context Menu

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2019-02-24 02:42:41 +00:00
parent 150c941340
commit 393fd26a42
1 changed files with 27 additions and 1 deletions

View File

@ -271,6 +271,28 @@ module.exports = React.createClass({
); );
}, },
_onClickSettings: function() {
dis.dispatch({
action: 'view_room',
room_id: this.props.room.roomId,
}, true);
dis.dispatch({ action: 'open_room_settings' });
if (this.props.onFinished) {
this.props.onFinished();
}
},
_renderSettingsMenu: function() {
return (
<div>
<div className="mx_RoomTileContextMenu_tag_field" onClick={this._onClickSettings} >
<img className="mx_RoomTileContextMenu_tag_icon" src={require("../../../../res/img/icons-settings-room.svg")} width="15" height="15" />
{ _t('Settings') }
</div>
</div>
);
},
_renderLeaveMenu: function(membership) { _renderLeaveMenu: function(membership) {
if (!membership) { if (!membership) {
return null; return null;
@ -350,13 +372,17 @@ module.exports = React.createClass({
// Can't set notif level or tags on non-join rooms // Can't set notif level or tags on non-join rooms
if (myMembership !== 'join') { if (myMembership !== 'join') {
return this._renderLeaveMenu(myMembership); return <div>
{ this._renderSettingsMenu() }
{ this._renderLeaveMenu(myMembership) }
</div>;
} }
return ( return (
<div> <div>
{ this._renderNotifMenu() } { this._renderNotifMenu() }
<hr className="mx_RoomTileContextMenu_separator" /> <hr className="mx_RoomTileContextMenu_separator" />
{ this._renderSettingsMenu() }
{ this._renderLeaveMenu(myMembership) } { this._renderLeaveMenu(myMembership) }
<hr className="mx_RoomTileContextMenu_separator" /> <hr className="mx_RoomTileContextMenu_separator" />
{ this._renderRoomTagMenu() } { this._renderRoomTagMenu() }