Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 9027780

Browse files
committed
Show group name in flair tooltip if one is set
e.g. "Group Name (+group_id:homeserver)" or "+group_id:homeserver" Fixes element-hq/element-web#5341
1 parent be5e672 commit 9027780

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/views/elements/Flair.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,22 @@ class FlairAvatar extends React.Component {
4343
render() {
4444
const httpUrl = this.context.matrixClient.mxcUrlToHttp(
4545
this.props.groupProfile.avatarUrl, 16, 16, 'scale', false);
46+
const tooltip = this.props.groupProfile.name ?
47+
`${this.props.groupProfile.name} (${this.props.groupProfile.groupId})`:
48+
this.props.groupProfile.groupId;
4649
return <img
4750
src={httpUrl}
4851
width="16"
4952
height="16"
5053
onClick={this.onClick}
51-
title={this.props.groupProfile.groupId} />;
54+
title={tooltip} />;
5255
}
5356
}
5457

5558
FlairAvatar.propTypes = {
5659
groupProfile: PropTypes.shape({
5760
groupId: PropTypes.string.isRequired,
61+
name: PropTypes.string.isRequired,
5862
avatarUrl: PropTypes.string.isRequired,
5963
}),
6064
};

0 commit comments

Comments
 (0)