Revert to avatar only when custom status disabled
This returns to the previous behavior of avatar only without a button when the custom status feature is disabled so that you don't get pointer cursor for something that does nothing when clicked. The avatar ring spacing is kept consistent with and without the feature enabled by using a different class in CSS.
This commit is contained in:
parent
632bbde598
commit
4b13774585
2 changed files with 15 additions and 16 deletions
|
@ -108,27 +108,26 @@ export default class MemberStatusMessageAvatar extends React.Component {
|
|||
};
|
||||
|
||||
render() {
|
||||
const customStatusFeatureEnabled =
|
||||
SettingsStore.isFeatureEnabled("feature_custom_status");
|
||||
const avatar = <MemberAvatar
|
||||
member={this.props.member}
|
||||
width={this.props.width}
|
||||
height={this.props.height}
|
||||
resizeMethod={this.props.resizeMethod}
|
||||
/>;
|
||||
|
||||
let onClick = null;
|
||||
let hasStatus = false;
|
||||
|
||||
if (customStatusFeatureEnabled) {
|
||||
onClick = this._onClick;
|
||||
hasStatus = this.state.hasStatus;
|
||||
if (!SettingsStore.isFeatureEnabled("feature_custom_status")) {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
const classes = classNames({
|
||||
"mx_MemberStatusMessageAvatar": true,
|
||||
"mx_MemberStatusMessageAvatar_hasStatus": hasStatus,
|
||||
"mx_MemberStatusMessageAvatar_hasStatus": this.state.hasStatus,
|
||||
});
|
||||
|
||||
return <AccessibleButton onClick={onClick} className={classes} element="div">
|
||||
<MemberAvatar member={this.props.member}
|
||||
width={this.props.width}
|
||||
height={this.props.height}
|
||||
resizeMethod={this.props.resizeMethod} />
|
||||
return <AccessibleButton className={classes}
|
||||
element="div" onClick={this._onClick}
|
||||
>
|
||||
{avatar}
|
||||
</AccessibleButton>;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue