mirror of https://github.com/vector-im/riot-web
				
				
				
			Merge pull request #2692 from matrix-org/t3chguy/room_context_menu_settings
Settings button in Room Context Menupull/21833/head
						commit
						18b27a72d8
					
				|  | @ -32,3 +32,13 @@ limitations under the License. | |||
| .mx_RoomSettingsDialog_warningIcon:before { | ||||
|     mask-image: url('$(res)/img/feather-icons/warning-triangle.svg'); | ||||
| } | ||||
| 
 | ||||
| .mx_RoomSettingsDialog .mx_Dialog_title { | ||||
|     -ms-text-overflow: ellipsis; | ||||
|     text-overflow: ellipsis; | ||||
|     white-space: nowrap; | ||||
|     overflow: hidden; | ||||
|     margin: 0 auto; | ||||
|     padding-left: 40px; | ||||
|     padding-right: 80px; | ||||
| } | ||||
|  |  | |||
|  | @ -271,6 +271,27 @@ module.exports = React.createClass({ | |||
|         ); | ||||
|     }, | ||||
| 
 | ||||
|     _onClickSettings: function() { | ||||
|         dis.dispatch({ | ||||
|             action: 'open_room_settings', | ||||
|             room_id: this.props.room.roomId, | ||||
|         }); | ||||
|         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) { | ||||
|         if (!membership) { | ||||
|             return null; | ||||
|  | @ -350,7 +371,11 @@ module.exports = React.createClass({ | |||
| 
 | ||||
|         // Can't set notif level or tags on non-join rooms
 | ||||
|         if (myMembership !== 'join') { | ||||
|             return this._renderLeaveMenu(myMembership); | ||||
|             return <div> | ||||
|                 { this._renderLeaveMenu(myMembership) } | ||||
|                 <hr className="mx_RoomTileContextMenu_separator" /> | ||||
|                 { this._renderSettingsMenu() } | ||||
|             </div>; | ||||
|         } | ||||
| 
 | ||||
|         return ( | ||||
|  | @ -360,6 +385,8 @@ module.exports = React.createClass({ | |||
|                 { this._renderLeaveMenu(myMembership) } | ||||
|                 <hr className="mx_RoomTileContextMenu_separator" /> | ||||
|                 { this._renderRoomTagMenu() } | ||||
|                 <hr className="mx_RoomTileContextMenu_separator" /> | ||||
|                 { this._renderSettingsMenu() } | ||||
|             </div> | ||||
|         ); | ||||
|     }, | ||||
|  |  | |||
|  | @ -23,6 +23,7 @@ import RolesRoomSettingsTab from "../settings/tabs/room/RolesRoomSettingsTab"; | |||
| import GeneralRoomSettingsTab from "../settings/tabs/room/GeneralRoomSettingsTab"; | ||||
| import SecurityRoomSettingsTab from "../settings/tabs/room/SecurityRoomSettingsTab"; | ||||
| import sdk from "../../../index"; | ||||
| import MatrixClientPeg from "../../../MatrixClientPeg"; | ||||
| 
 | ||||
| export default class RoomSettingsDialog extends React.Component { | ||||
|     static propTypes = { | ||||
|  | @ -60,9 +61,10 @@ export default class RoomSettingsDialog extends React.Component { | |||
|     render() { | ||||
|         const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); | ||||
| 
 | ||||
|         const roomName = MatrixClientPeg.get().getRoom(this.props.roomId).name; | ||||
|         return ( | ||||
|             <BaseDialog className='mx_RoomSettingsDialog' hasCancel={true} | ||||
|                         onFinished={this.props.onFinished} title={_t("Room Settings")}> | ||||
|                         onFinished={this.props.onFinished} title={_t("Room Settings - %(roomName)s", {roomName})}> | ||||
|                 <div className='ms_SettingsDialog_content'> | ||||
|                     <TabbedView tabs={this._getTabs()} /> | ||||
|                 </div> | ||||
|  |  | |||
|  | @ -1117,7 +1117,7 @@ | |||
|     "To help avoid duplicate issues, please <existingIssuesLink>view existing issues</existingIssuesLink> first (and add a +1) or <newIssueLink>create a new issue</newIssueLink> if you can't find it.": "To help avoid duplicate issues, please <existingIssuesLink>view existing issues</existingIssuesLink> first (and add a +1) or <newIssueLink>create a new issue</newIssueLink> if you can't find it.", | ||||
|     "Report bugs & give feedback": "Report bugs & give feedback", | ||||
|     "Go back": "Go back", | ||||
|     "Room Settings": "Room Settings", | ||||
|     "Room Settings - %(roomName)s": "Room Settings - %(roomName)s", | ||||
|     "Failed to upgrade room": "Failed to upgrade room", | ||||
|     "The room upgrade could not be completed": "The room upgrade could not be completed", | ||||
|     "Upgrade this room to version %(version)s": "Upgrade this room to version %(version)s", | ||||
|  |  | |||
|  | @ -119,7 +119,7 @@ class RoomViewStore extends Store { | |||
|             case 'open_room_settings': { | ||||
|                 const RoomSettingsDialog = sdk.getComponent("dialogs.RoomSettingsDialog"); | ||||
|                 Modal.createTrackedDialog('Room settings', '', RoomSettingsDialog, { | ||||
|                     roomId: this._state.roomId, | ||||
|                     roomId: payload.room_id || this._state.roomId, | ||||
|                 }, 'mx_SettingsDialog'); | ||||
|                 break; | ||||
|             } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Travis Ralston
						Travis Ralston