diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 1b3ed6e80d..af0c595ea9 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -1772,6 +1772,7 @@ module.exports = React.createClass({ oobData={this.props.oobData} editing={this.state.editingRoomSettings} saving={this.state.uploadingRoomSettings} + inRoom={myMember && myMember.membership === 'join'} collapsedRhs={ this.props.collapsedRhs } onSearchClick={this.onSearchClick} onSettingsClick={this.onSettingsClick} diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js index 94f2691f2c..4cf20454a0 100644 --- a/src/components/views/rooms/RoomHeader.js +++ b/src/components/views/rooms/RoomHeader.js @@ -17,6 +17,7 @@ limitations under the License. 'use strict'; var React = require('react'); +var classNames = require('classnames'); var sdk = require('../../../index'); var MatrixClientPeg = require('../../../MatrixClientPeg'); var Modal = require("../../../Modal"); @@ -39,6 +40,7 @@ module.exports = React.createClass({ oobData: React.PropTypes.object, editing: React.PropTypes.bool, saving: React.PropTypes.bool, + inRoom: React.PropTypes.bool, collapsedRhs: React.PropTypes.bool, onSettingsClick: React.PropTypes.func, onSaveClick: React.PropTypes.func, @@ -49,7 +51,7 @@ module.exports = React.createClass({ getDefaultProps: function() { return { editing: false, - onSettingsClick: function() {}, + inRoom: false, onSaveClick: function() {}, }; }, @@ -225,10 +227,10 @@ module.exports = React.createClass({ roomName = this.props.room.name; } - + const emojiTextClasses = classNames('mx_RoomHeader_nametext', { mx_RoomHeader_settingsHint: settingsHint }); name =
- {roomName} + { roomName } { searchStatus }
; } @@ -299,6 +301,14 @@ module.exports = React.createClass({ ; } + let search_button; + if (this.props.onSearchClick && this.props.inRoom) { + search_button = + + + ; + } + var rightPanel_buttons; if (this.props.collapsedRhs) { rightPanel_buttons = @@ -313,9 +323,7 @@ module.exports = React.createClass({
{ settings_button } { forget_button } - - - + { search_button } { rightPanel_buttons }
; } diff --git a/src/components/views/rooms/RoomPreviewBar.js b/src/components/views/rooms/RoomPreviewBar.js index 43c3b05295..5b7ec9347b 100644 --- a/src/components/views/rooms/RoomPreviewBar.js +++ b/src/components/views/rooms/RoomPreviewBar.js @@ -47,7 +47,7 @@ module.exports = React.createClass({ // The alias that was used to access this room, if appropriate // If given, this will be how the room is referred to (eg. // in error messages). - roomAlias: React.PropTypes.object, + roomAlias: React.PropTypes.string, }, getDefaultProps: function() {