From ce3dab3c5be05cd5be6513cc7f740ba7d89fd4c8 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 16 Jul 2015 17:42:33 +0100 Subject: [PATCH] Make room name editable --- skins/base/views/molecules/RoomHeader.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/skins/base/views/molecules/RoomHeader.js b/skins/base/views/molecules/RoomHeader.js index 62f24484..33d43302 100644 --- a/skins/base/views/molecules/RoomHeader.js +++ b/skins/base/views/molecules/RoomHeader.js @@ -17,14 +17,20 @@ limitations under the License. 'use strict'; var React = require('react'); +var ComponentBroker = require('../../../../src/ComponentBroker'); var MatrixClientPeg = require("../../../../src/MatrixClientPeg"); var RoomHeaderController = require("../../../../src/controllers/molecules/RoomHeader"); +var EditableText = ComponentBroker.get("atoms/EditableText"); module.exports = React.createClass({ displayName: 'RoomHeader', mixins: [RoomHeaderController], + onNameChange: function(new_name) { + MatrixClientPeg.get().setRoomName(this.props.room.roomId, new_name); + }, + render: function() { var topic = this.props.room.currentState.getStateEvents('m.room.topic', ''); @@ -52,7 +58,9 @@ module.exports = React.createClass({
-
{ this.props.room.name }
+
+ +
{ topic }
@@ -76,4 +84,3 @@ module.exports = React.createClass({ ); }, }); -