Skip to content

Commit c8826ba

Browse files
committed
Implement a tooltip for the surplus icon with the names of the extra avatars.
1 parent 8aa3f26 commit c8826ba

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

web-ui/src/components/kudos/PublicKudosCard.jsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,22 @@ const KudosCard = ({ kudos }) => {
6666
);
6767
}
6868

69+
const multiTooltip = (num, list) => {
70+
let tooltip = "";
71+
let prefix = "";
72+
for (let member of list.slice(-num)) {
73+
tooltip += prefix + `${member.firstName} ${member.lastName}`;
74+
prefix = ", ";
75+
}
76+
return <Tooltip arrow key="multi-member-tooltip" title={tooltip}>
77+
{`+${num}`}
78+
</Tooltip>;
79+
};
80+
6981
return (
70-
<AvatarGroup max={4}>
82+
<AvatarGroup max={4}
83+
renderSurplus={(extra) => multiTooltip(
84+
extra, kudos.recipientMembers)}>
7185
{kudos.recipientMembers.map((member) => (
7286
<Tooltip
7387
arrow

0 commit comments

Comments
 (0)