diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js index fa0c63dfdd..0842d0f4dd 100644 --- a/src/components/views/rooms/RoomHeader.js +++ b/src/components/views/rooms/RoomHeader.js @@ -27,6 +27,7 @@ var linkify = require('linkifyjs'); var linkifyElement = require('linkifyjs/element'); var linkifyMatrix = require('../../../linkify-matrix'); import AccessibleButton from '../elements/AccessibleButton'; +import {CancelButton} from './SimpleRoomHeader'; linkifyMatrix(linkify); @@ -184,7 +185,7 @@ module.exports = React.createClass({ ); save_button = Save; - cancel_button = Cancel ; + cancel_button = ; } if (this.props.saving) { diff --git a/src/components/views/rooms/SimpleRoomHeader.js b/src/components/views/rooms/SimpleRoomHeader.js index bc2f4bca69..40995d2a72 100644 --- a/src/components/views/rooms/SimpleRoomHeader.js +++ b/src/components/views/rooms/SimpleRoomHeader.js @@ -16,16 +16,27 @@ limitations under the License. 'use strict'; -var React = require('react'); -var sdk = require('../../../index'); -var dis = require("../../../dispatcher"); +import React from 'react'; +import dis from '../../../dispatcher'; import AccessibleButton from '../elements/AccessibleButton'; +// cancel button which is shared between room header and simple room header +export function CancelButton(props) { + const {onClick} = props; + + return ( + + Cancel + + ); +} + /* * A stripped-down room header used for things like the user settings * and room directory. */ -module.exports = React.createClass({ +export default React.createClass({ displayName: 'SimpleRoomHeader', propTypes: { @@ -41,15 +52,15 @@ module.exports = React.createClass({ }, render: function() { - var TintableSvg = sdk.getComponent("elements.TintableSvg"); - - var cancelButton; + let cancelButton; if (this.props.onCancelClick) { - cancelButton = Cancel ; + cancelButton = ; } - var showRhsButton; + let showRhsButton; /* // don't bother cluttering things up with this for now. + const TintableSvg = sdk.getComponent("elements.TintableSvg"); + if (this.props.collapsedRhs) { showRhsButton =