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

Commit 981ca45

Browse files
authored
Merge pull request #1596 from matrix-org/luke/groups-show-name-in-flair-tootip
Show group name in flair tooltip if one is set
2 parents 90a63d7 + 6deeaf9 commit 981ca45

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,
5862
avatarUrl: PropTypes.string.isRequired,
5963
}),
6064
};

0 commit comments

Comments
 (0)