mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-05 03:36:51 +03:00
Remove now unused 'edit' block
And add some css classes
This commit is contained in:
parent
381f685013
commit
f6f80bf9ce
1 changed files with 12 additions and 56 deletions
|
@ -312,52 +312,6 @@ export default React.createClass({
|
||||||
|
|
||||||
if (this.state.summary === null && this.state.error === null) {
|
if (this.state.summary === null && this.state.error === null) {
|
||||||
return <Loader />;
|
return <Loader />;
|
||||||
} else if (false && this.state.editing) {
|
|
||||||
const summary = this.state.summary;
|
|
||||||
const avatarEdit = (
|
|
||||||
<div className="mx_GroupView_avatarPicker">
|
|
||||||
<div onClick={this.onAvatarPickerClick}>
|
|
||||||
<ChangeAvatar ref={this._collectChangeAvatar}
|
|
||||||
groupId={this.props.groupId}
|
|
||||||
initialAvatarUrl={this.state.summary.profile.avatar_url}
|
|
||||||
setAvatar={false} onAvatar={this._onAvatarChange}
|
|
||||||
showUploadSection={false} width={48} height={48}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="mx_GroupView_avatarPicker_edit">
|
|
||||||
<label htmlFor="avatarInput" ref="file_label">
|
|
||||||
<img src="img/camera.svg"
|
|
||||||
alt={ _t("Upload avatar") } title={ _t("Upload avatar") }
|
|
||||||
width="17" height="15" />
|
|
||||||
</label>
|
|
||||||
<input id="avatarInput" className="mx_GroupView_uploadInput" type="file" onChange={this._onAvatarSelected}/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
return <div>
|
|
||||||
{avatarEdit}
|
|
||||||
<input type="text"
|
|
||||||
value={this.state.profileForm.name}
|
|
||||||
onChange={this._onNameChange}
|
|
||||||
placeholder={_t('Group Name')}
|
|
||||||
/>
|
|
||||||
<input type="text"
|
|
||||||
value={this.state.profileForm.short_description}
|
|
||||||
onChange={this._onShortDescChange}
|
|
||||||
placeholder={_t('Description')}
|
|
||||||
/>
|
|
||||||
<AccessibleButton className="mx_GroupView_saveButton" onClick={this._onSaveClick}>
|
|
||||||
{_t('Save')}
|
|
||||||
</AccessibleButton>
|
|
||||||
<AccessibleButton className='mx_GroupView_cancelButton' onClick={this._onCancelClick}>
|
|
||||||
<img src="img/cancel.svg" className='mx_filterFlipColor'
|
|
||||||
width="18" height="18" alt={_t("Cancel")}/>
|
|
||||||
</AccessibleButton>
|
|
||||||
<textarea value={this.state.profileForm.long_description}
|
|
||||||
onChange={this._onLongDescChange}
|
|
||||||
/>
|
|
||||||
</div>;
|
|
||||||
} else if (this.state.summary) {
|
} else if (this.state.summary) {
|
||||||
const summary = this.state.summary;
|
const summary = this.state.summary;
|
||||||
|
|
||||||
|
@ -365,6 +319,7 @@ export default React.createClass({
|
||||||
let nameNode;
|
let nameNode;
|
||||||
let shortDescNode;
|
let shortDescNode;
|
||||||
let rightButtons;
|
let rightButtons;
|
||||||
|
let headerBottom;
|
||||||
let roomBody;
|
let roomBody;
|
||||||
if (this.state.editing) {
|
if (this.state.editing) {
|
||||||
avatarNode = (
|
avatarNode = (
|
||||||
|
@ -397,19 +352,20 @@ export default React.createClass({
|
||||||
onChange={this._onShortDescChange}
|
onChange={this._onShortDescChange}
|
||||||
placeholder={_t('Description')}
|
placeholder={_t('Description')}
|
||||||
/>
|
/>
|
||||||
roomBody = <div>
|
rightButtons = <span>
|
||||||
<textarea value={this.state.profileForm.long_description}
|
<AccessibleButton className="mx_GroupView_saveButton mx_RoomHeader_textButton" onClick={this._onSaveClick}>
|
||||||
onChange={this._onLongDescChange}
|
|
||||||
/>
|
|
||||||
</div>;
|
|
||||||
rightButtons = <div>
|
|
||||||
<AccessibleButton className="mx_GroupView_saveButton" onClick={this._onSaveClick}>
|
|
||||||
{_t('Save')}
|
{_t('Save')}
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
<AccessibleButton className='mx_GroupView_cancelButton' onClick={this._onCancelClick}>
|
<AccessibleButton className='mx_GroupView_cancelButton' onClick={this._onCancelClick}>
|
||||||
<img src="img/cancel.svg" className='mx_filterFlipColor'
|
<img src="img/cancel.svg" className='mx_filterFlipColor'
|
||||||
width="18" height="18" alt={_t("Cancel")}/>
|
width="18" height="18" alt={_t("Cancel")}/>
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
|
</span>;
|
||||||
|
headerBottom = <div className="mx_GroupView_header_editBottom" />;
|
||||||
|
roomBody = <div>
|
||||||
|
<textarea className="mx_GroupView_editLongDesc" value={this.state.profileForm.long_description}
|
||||||
|
onChange={this._onLongDescChange}
|
||||||
|
/>
|
||||||
</div>;
|
</div>;
|
||||||
} else {
|
} else {
|
||||||
const groupAvatarUrl = summary.profile ? summary.profile.avatar_url : null;
|
const groupAvatarUrl = summary.profile ? summary.profile.avatar_url : null;
|
||||||
|
@ -428,14 +384,13 @@ export default React.createClass({
|
||||||
} else {
|
} else {
|
||||||
nameNode = <span>{this.props.groupId}</span>;
|
nameNode = <span>{this.props.groupId}</span>;
|
||||||
}
|
}
|
||||||
shortDescNode = <div className="mx_RoomHeader_topic">
|
shortDescNode = <span>{summary.profile.short_description}</span>;
|
||||||
{summary.profile.short_description}
|
|
||||||
</div>;
|
|
||||||
|
|
||||||
let description = null;
|
let description = null;
|
||||||
if (summary.profile && summary.profile.long_description) {
|
if (summary.profile && summary.profile.long_description) {
|
||||||
description = sanitizedHtmlNode(summary.profile.long_description);
|
description = sanitizedHtmlNode(summary.profile.long_description);
|
||||||
}
|
}
|
||||||
|
headerBottom = <div className="mx_GroupView_header_viewBottom" />;
|
||||||
roomBody = <div>
|
roomBody = <div>
|
||||||
<div className="mx_GroupView_groupDesc">{description}</div>
|
<div className="mx_GroupView_groupDesc">{description}</div>
|
||||||
{this._getFeaturedRoomsNode()}
|
{this._getFeaturedRoomsNode()}
|
||||||
|
@ -466,6 +421,7 @@ export default React.createClass({
|
||||||
{rightButtons}
|
{rightButtons}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{headerBottom}
|
||||||
{roomBody}
|
{roomBody}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue