You've already forked element-web
mirror of
https://github.com/element-hq/element-web.git
synced 2025-12-01 09:58:03 +03:00
add cancelButton to simpleHeader
This commit is contained in:
@@ -1025,6 +1025,7 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
onUserSettingsClose: function() {
|
onUserSettingsClose: function() {
|
||||||
// XXX: use browser history instead to find the previous room?
|
// XXX: use browser history instead to find the previous room?
|
||||||
|
// or maintain a this.state.pageHistory in _setPage()?
|
||||||
if (this.state.currentRoom) {
|
if (this.state.currentRoom) {
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'view_room',
|
action: 'view_room',
|
||||||
|
|||||||
@@ -340,7 +340,7 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_UserSettings">
|
<div className="mx_UserSettings">
|
||||||
<SimpleRoomHeader title="Settings"/>
|
<SimpleRoomHeader title="Settings" onCancelClick={ this.props.onClose }/>
|
||||||
|
|
||||||
<GeminiScrollbar className="mx_UserSettings_body" autoshow={true}>
|
<GeminiScrollbar className="mx_UserSettings_body" autoshow={true}>
|
||||||
|
|
||||||
|
|||||||
@@ -27,14 +27,21 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
title: React.PropTypes.string,
|
title: React.PropTypes.string,
|
||||||
|
onCancelClick: React.PropTypes.func,
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
var cancelButton;
|
||||||
|
if (this.props.onCancelClick) {
|
||||||
|
cancelButton = <div className="mx_RoomHeader_cancelButton" onClick={this.props.onCancelClick}><img src="img/cancel.svg" width="18" height="18" alt="Cancel"/> </div>
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_RoomHeader" >
|
<div className="mx_RoomHeader" >
|
||||||
<div className="mx_RoomHeader_wrapper">
|
<div className="mx_RoomHeader_wrapper">
|
||||||
<div className="mx_RoomHeader_simpleHeader">
|
<div className="mx_RoomHeader_simpleHeader">
|
||||||
{ this.props.title }
|
{ this.props.title }
|
||||||
|
{ cancelButton }
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user