From 19770563f4d9c972684038d9e5e285fed2777a0a Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 15 Apr 2016 22:16:19 +0100 Subject: [PATCH] add cancelButton to simpleHeader --- src/components/structures/MatrixChat.js | 1 + src/components/structures/UserSettings.js | 2 +- src/components/views/rooms/SimpleRoomHeader.js | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 86614782fa..84a91896c5 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1025,6 +1025,7 @@ module.exports = React.createClass({ onUserSettingsClose: function() { // XXX: use browser history instead to find the previous room? + // or maintain a this.state.pageHistory in _setPage()? if (this.state.currentRoom) { dis.dispatch({ action: 'view_room', diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index e6895df41d..0b6815980c 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -340,7 +340,7 @@ module.exports = React.createClass({ return (
- + diff --git a/src/components/views/rooms/SimpleRoomHeader.js b/src/components/views/rooms/SimpleRoomHeader.js index 8388da4a71..2f8c5eaf11 100644 --- a/src/components/views/rooms/SimpleRoomHeader.js +++ b/src/components/views/rooms/SimpleRoomHeader.js @@ -27,14 +27,21 @@ module.exports = React.createClass({ propTypes: { title: React.PropTypes.string, + onCancelClick: React.PropTypes.func, }, render: function() { + var cancelButton; + if (this.props.onCancelClick) { + cancelButton =
Cancel
+ } + return (
{ this.props.title } + { cancelButton }