From 0b06e979cb1bd0cd3ea3174379782cb6d41f5d77 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 27 Apr 2017 17:57:13 +0100 Subject: [PATCH] Add optional tintable SVG icon for SimpleRoomHeader --- src/components/views/rooms/SimpleRoomHeader.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/SimpleRoomHeader.js b/src/components/views/rooms/SimpleRoomHeader.js index 40995d2a72..1559f7ef85 100644 --- a/src/components/views/rooms/SimpleRoomHeader.js +++ b/src/components/views/rooms/SimpleRoomHeader.js @@ -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) { @@ -43,8 +44,8 @@ export default React.createClass({ title: React.PropTypes.string, onCancelClick: React.PropTypes.func, - // is the RightPanel collapsed? - collapsedRhs: React.PropTypes.bool, + // `src` to a TintableSvg. Optional. + icon: React.PropTypes.string, }, onShowRhsClick: function(ev) { @@ -53,9 +54,17 @@ export default React.createClass({ render: function() { let cancelButton; + let icon; if (this.props.onCancelClick) { cancelButton = ; } + if (this.props.icon) { + const TintableSvg = sdk.getComponent('elements.TintableSvg'); + icon = ; + } let showRhsButton; /* // don't bother cluttering things up with this for now. @@ -73,6 +82,7 @@ export default React.createClass({
+ { icon } { this.props.title } { showRhsButton } { cancelButton }