You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-22 04:02:40 +03:00
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:
@@ -14,13 +14,13 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
.mx_MemberStatusMessageAvatar .mx_BaseAvatar {
|
||||
.mx_MessageComposer_avatar .mx_BaseAvatar {
|
||||
padding: 1.5px;
|
||||
border: 1.2px solid transparent;
|
||||
border-radius: 14px;
|
||||
}
|
||||
|
||||
.mx_MemberStatusMessageAvatar .mx_BaseAvatar_initial {
|
||||
.mx_MessageComposer_avatar .mx_BaseAvatar_initial {
|
||||
left: 1.5px;
|
||||
}
|
||||
|
||||
|
||||
@@ -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>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user