From 74360f848491cc0aefe86b10ef8fc51c7c840662 Mon Sep 17 00:00:00 2001 From: Michael An <1822852997@qq.com> Date: Sat, 29 Jun 2019 14:35:55 +0800 Subject: [PATCH] add participant avatar tooltip --- .../components/file-view/participants-list.js | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/file-view/participants-list.js b/frontend/src/components/file-view/participants-list.js index 1277da8333..2a4d6f4ede 100644 --- a/frontend/src/components/file-view/participants-list.js +++ b/frontend/src/components/file-view/participants-list.js @@ -37,7 +37,7 @@ class ParticipantsList extends React.Component { return (
{participants.map((item, index) => { - return avatar; + return ; })} @@ -65,4 +65,38 @@ class ParticipantsList extends React.Component { ParticipantsList.propTypes = propTypes; +const ParticipantPropTypes = { + index: PropTypes.number.isRequired, + item: PropTypes.object.isRequired, +}; + +class Participant extends React.Component { + + constructor(props) { + super(props); + this.state = { + showAvatarTooltip: false, + }; + } + + toggleAvatarTooltip = () => { + this.setState({ showAvatarTooltip: !this.state.showAvatarTooltip }); + } + + render() { + const { item, index } = this.props; + const target = 'participant-avatar-' + index; + return ( + + avatar + + {item.name} + + + ); + } +} + +Participant.propTypes = ParticipantPropTypes; + export default ParticipantsList;