;
}
if (this.props.saving) {
- var Spinner = sdk.getComponent("elements.Spinner");
+ const Spinner = sdk.getComponent("elements.Spinner");
spinner =
;
}
- if (can_set_room_name) {
- var RoomNameEditor = sdk.getComponent("rooms.RoomNameEditor");
+ if (canSetRoomName) {
+ const RoomNameEditor = sdk.getComponent("rooms.RoomNameEditor");
name = ;
- }
- else {
- var searchStatus;
+ } else {
// don't display the search count until the search completes and
// gives us a valid (possibly zero) searchCount.
- if (this.props.searchInfo && this.props.searchInfo.searchCount !== undefined && this.props.searchInfo.searchCount !== null) {
- searchStatus = { _t("(~%(count)s results)", { count: this.props.searchInfo.searchCount }) }
;
+ if (this.props.searchInfo &&
+ this.props.searchInfo.searchCount !== undefined &&
+ this.props.searchInfo.searchCount !== null) {
+ searchStatus =
+ { _t("(~%(count)s results)", { count: this.props.searchInfo.searchCount }) }
+
;
}
// XXX: this is a bit inefficient - we could just compare room.name for 'Empty room'...
- var settingsHint = false;
- var members = this.props.room ? this.props.room.getJoinedMembers() : undefined;
+ let settingsHint = false;
+ const members = this.props.room ? this.props.room.getJoinedMembers() : undefined;
if (members) {
if (members.length === 1 && members[0].userId === MatrixClientPeg.get().credentials.userId) {
- var name = this.props.room.currentState.getStateEvents('m.room.name', '');
+ name = this.props.room.currentState.getStateEvents('m.room.name', '');
if (!name || !name.getContent().name) {
settingsHint = true;
}
}
}
- var roomName = _t("Join Room");
+ let roomName = _t("Join Room");
if (this.props.oobData && this.props.oobData.name) {
roomName = this.props.oobData.name;
} else if (this.props.room) {
@@ -243,24 +238,25 @@ module.exports = React.createClass({
;
}
- if (can_set_room_topic) {
- var RoomTopicEditor = sdk.getComponent("rooms.RoomTopicEditor");
- topic_el = ;
+ if (canSetRoomTopic) {
+ const RoomTopicEditor = sdk.getComponent("rooms.RoomTopicEditor");
+ topicElement = ;
} else {
- var topic;
+ let topic;
if (this.props.room) {
- var ev = this.props.room.currentState.getStateEvents('m.room.topic', '');
+ const ev = this.props.room.currentState.getStateEvents('m.room.topic', '');
if (ev) {
topic = ev.getContent().topic;
}
}
if (topic) {
- topic_el = { topic }
;
+ topicElement =
+ { topic }
;
}
}
- var roomAvatar = null;
- if (can_set_room_avatar) {
+ let roomAvatar = null;
+ if (canSetRoomAvatar) {
roomAvatar = (
@@ -276,8 +272,7 @@ module.exports = React.createClass({
);
- }
- else if (this.props.room || (this.props.oobData && this.props.oobData.name)) {
+ } else if (this.props.room || (this.props.oobData && this.props.oobData.name)) {
roomAvatar = (
@@ -285,9 +280,8 @@ module.exports = React.createClass({
);
}
- var settings_button;
if (this.props.onSettingsClick) {
- settings_button =
+ settingsButton =
;
@@ -301,61 +295,58 @@ module.exports = React.createClass({
//
;
// }
- var forget_button;
+ let forgetButton;
if (this.props.onForgetClick) {
- forget_button =
+ forgetButton =
;
}
- let search_button;
+ let searchButton;
if (this.props.onSearchClick && this.props.inRoom) {
- search_button =
+ searchButton =
;
}
- var rightPanel_buttons;
+ let rightPanelButtons;
if (this.props.collapsedRhs) {
- rightPanel_buttons =
+ rightPanelButtons =
;
}
- var right_row;
+ let rightRow;
if (!this.props.editing) {
- right_row =
+ rightRow =
- { settings_button }
- { forget_button }
- { search_button }
- { rightPanel_buttons }
+ { settingsButton }
+ { forgetButton }
+ { searchButton }
+ { rightPanelButtons }
;
}
- header =
-
-
-
- { roomAvatar }
-
-
- { name }
- { topic_el }
-
-
- {spinner}
- {save_button}
- {cancel_button}
- {right_row}
-
;
-
return (
- { header }
+
+
+
+ { roomAvatar }
+
+
+ { name }
+ { topicElement }
+
+
+ {spinner}
+ {saveButton}
+ {cancelButton}
+ {rightRow}
+
);
},