/* global APP */ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import UIEvents from '../../../../service/UI/UIEvents'; import { Avatar } from '../../base/participants'; /** * Implements a React {@code Component} for showing a participant's avatar and * name and emits an event when it has been clicked. * * @extends Component */ class ContactListItem extends Component { /** * Default values for {@code ContactListItem} component's properties. * * @static */ static propTypes = { /** * The link to the participant's avatar image. */ avatarURI: PropTypes.string, /** * An id attribute to set on the root of {@code ContactListItem}. Used * by the torture tests. */ id: PropTypes.string, /** * The participant's display name. */ name: PropTypes.string }; /** * Initializes new {@code ContactListItem} instance. * * @param {Object} props - The read-only properties with which the new * instance is to be initialized. */ constructor(props) { super(props); // Bind event handler so it is only bound once for every instance. this._onClick = this._onClick.bind(this); } /** * Implements React's {@link Component#render()}. * * @inheritdoc * @returns {ReactElement} */ render() { return (
{ this.props.name }