From 1087b365978f0ec3a5ebb10e10dbd9aee4b0e932 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Wed, 18 Oct 2017 17:32:46 +0100 Subject: [PATCH 1/2] 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( Date: Thu, 19 Oct 2017 01:48:49 +0200 Subject: [PATCH 2/2] fix lint --- src/components/structures/GroupView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index c4edc4cea4..5da4e7b413 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -899,7 +899,7 @@ export default React.createClass({ initialValue={this.state.profileForm.short_description} onValueChanged={this._onShortDescChange} tabIndex="2" - dir="auto" /> + dir="auto" />; rightButtons.push(