From 1087b365978f0ec3a5ebb10e10dbd9aee4b0e932 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Wed, 18 Oct 2017 17:32:46 +0100 Subject: [PATCH] fix editing visuals on groupview header --- src/components/structures/GroupView.js | 49 ++++++++++++++++---------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index 26f8c4a413..c4edc4cea4 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -490,15 +490,15 @@ export default React.createClass({ }); }, - _onNameChange: function(e) { - const newProfileForm = Object.assign(this.state.profileForm, { name: e.target.value }); + _onNameChange: function(value) { + const newProfileForm = Object.assign(this.state.profileForm, { name: value }); this.setState({ profileForm: newProfileForm, }); }, - _onShortDescChange: function(e) { - const newProfileForm = Object.assign(this.state.profileForm, { short_description: e.target.value }); + _onShortDescChange: function(value) { + const newProfileForm = Object.assign(this.state.profileForm, { short_description: value }); this.setState({ profileForm: newProfileForm, }); @@ -878,18 +878,29 @@ export default React.createClass({ ); - nameNode = ; - shortDescNode = ; + + const EditableText = sdk.getComponent("elements.EditableText"); + + nameNode = ; + + shortDescNode = + rightButtons.push( ; if (summary.profile && summary.profile.name) { - nameNode =
+ nameNode =
{ summary.profile.name } ({ this.props.groupId })
; } else { - nameNode = { this.props.groupId }; + nameNode = { this.props.groupId }; } if (summary.profile && summary.profile.short_description) { - shortDescNode = { summary.profile.short_description }; + shortDescNode = { summary.profile.short_description }; } rightButtons.push(