jiti-meet/react/features/base/participants/components/Avatar.web.js

40 lines
851 B
JavaScript
Raw Normal View History

2017-02-27 21:42:28 +00:00
import React, { Component } from 'react';
/**
* Implements an avatar as a React/Web {@link Component}.
2017-02-27 21:42:28 +00:00
*/
export default class Avatar extends Component {
/**
* Avatar component's property types.
*
* @static
*/
static propTypes = {
/**
* The URI of the {@link Avatar}.
2017-02-27 21:42:28 +00:00
*
* @type {string}
*/
uri: React.PropTypes.string
};
2017-02-27 21:42:28 +00:00
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
*/
render() {
// Propagate all props of this Avatar but the ones consumed by this
// Avatar to the img it renders.
// eslint-disable-next-line no-unused-vars
const { uri, ...props } = this.props;
return (
<img
{ ...props }
src = { uri } />
);
2017-02-27 21:42:28 +00:00
}
}