You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Avatar.web.js 880B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import React, { Component } from 'react';
  2. import { styles } from './styles';
  3. /**
  4. * Display a participant avatar.
  5. */
  6. export default class Avatar extends Component {
  7. /**
  8. * Implements React's {@link Component#render()}.
  9. *
  10. * @inheritdoc
  11. */
  12. render() {
  13. const style = {
  14. // XXX Avatar is expected to display the whole image.
  15. objectFit: 'contain',
  16. ...styles.avatar,
  17. ...this.props.style
  18. };
  19. return (
  20. <img
  21. src = { this.props.uri }
  22. style = { style } />
  23. );
  24. }
  25. }
  26. /**
  27. * Avatar component's property types.
  28. *
  29. * @static
  30. */
  31. Avatar.propTypes = {
  32. /**
  33. * The optional style to add to an Avatar in order to customize its base
  34. * look (and feel).
  35. */
  36. style: React.PropTypes.object,
  37. uri: React.PropTypes.string
  38. };