2016-12-18 22:40:41 -05:00
|
|
|
import React, { PropTypes, Component } from 'react'
|
|
|
|
|
|
|
|
class Participant extends Component {
|
|
|
|
render() {
|
|
|
|
const { id, self, image, username, selfName, color } = this.props
|
|
|
|
return (
|
|
|
|
<div className={`participant participant-${id} ${self ? 'is-self' : ''}`}>
|
|
|
|
<div className="chat-participant-image">
|
|
|
|
<img src={image} style={{ border: `2px solid ${color}`}} />
|
|
|
|
</div>
|
|
|
|
<div className="chat-participant-name">
|
|
|
|
{username} {self ? '(me)' : ''}
|
|
|
|
</div>
|
|
|
|
<button
|
|
|
|
className='button chat-participant-invite-call'
|
|
|
|
onClick={this.props.inviteACall} // Realtime.inviteACall(id)
|
|
|
|
/>
|
|
|
|
<button
|
|
|
|
className="button chat-participant-invite-join"
|
|
|
|
onClick={this.props.inviteToJoin} // Realtime.inviteToJoin(id)
|
|
|
|
/>
|
|
|
|
<span className="chat-participant-participating">
|
|
|
|
<div className="green-dot"></div>
|
|
|
|
</span>
|
|
|
|
<div className="clearfloat"></div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-19 00:08:48 -05:00
|
|
|
Participant.propTypes = {
|
2016-12-18 23:24:57 -05:00
|
|
|
color: PropTypes.string, // css color
|
2016-12-18 22:40:41 -05:00
|
|
|
id: PropTypes.number,
|
|
|
|
image: PropTypes.string, // image url
|
|
|
|
self: PropTypes.bool,
|
2016-12-18 23:24:57 -05:00
|
|
|
username: PropTypes.string
|
2016-12-18 22:40:41 -05:00
|
|
|
}
|
|
|
|
|
2016-12-19 00:08:48 -05:00
|
|
|
export default Participant
|