Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #848 from matrix-org/luke/room-directory-improve
Browse files Browse the repository at this point in the history
Improve RoomDirectory Look & Feel
  • Loading branch information
dbkr authored Apr 27, 2017
2 parents 9d57e8b + 88abe54 commit b91f536
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/components/structures/LoggedInView.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,8 @@ export default React.createClass({
case PageTypes.RoomDirectory:
page_element = <RoomDirectory
ref="roomDirectory"
collapsedRhs={this.props.collapse_rhs}
config={this.props.config.roomDirectory}
/>;
if (!this.props.collapse_rhs) right_panel = <RightPanel opacity={this.props.sideOpacity}/>;
break;

case PageTypes.HomePage:
Expand Down
13 changes: 13 additions & 0 deletions src/components/views/rooms/SimpleRoomHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ limitations under the License.
import React from 'react';
import dis from '../../../dispatcher';
import AccessibleButton from '../elements/AccessibleButton';
import sdk from '../../../index';

// cancel button which is shared between room header and simple room header
export function CancelButton(props) {
Expand All @@ -45,6 +46,9 @@ export default React.createClass({

// is the RightPanel collapsed?
collapsedRhs: React.PropTypes.bool,

// `src` to a TintableSvg. Optional.
icon: React.PropTypes.string,
},

onShowRhsClick: function(ev) {
Expand All @@ -53,9 +57,17 @@ export default React.createClass({

render: function() {
let cancelButton;
let icon;
if (this.props.onCancelClick) {
cancelButton = <CancelButton onClick={this.props.onCancelClick} />;
}
if (this.props.icon) {
const TintableSvg = sdk.getComponent('elements.TintableSvg');
icon = <TintableSvg
className="mx_RoomHeader_icon" src={this.props.icon}
width="25" height="25"
/>;
}

let showRhsButton;
/* // don't bother cluttering things up with this for now.
Expand All @@ -73,6 +85,7 @@ export default React.createClass({
<div className="mx_RoomHeader" >
<div className="mx_RoomHeader_wrapper">
<div className="mx_RoomHeader_simpleHeader">
{ icon }
{ this.props.title }
{ showRhsButton }
{ cancelButton }
Expand Down

0 comments on commit b91f536

Please sign in to comment.