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 851B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import React, { Component } from 'react';
  2. /**
  3. * Implements an avatar as a React/Web {@link Component}.
  4. */
  5. export default class Avatar extends Component {
  6. /**
  7. * Avatar component's property types.
  8. *
  9. * @static
  10. */
  11. static propTypes = {
  12. /**
  13. * The URI of the {@link Avatar}.
  14. *
  15. * @type {string}
  16. */
  17. uri: React.PropTypes.string
  18. };
  19. /**
  20. * Implements React's {@link Component#render()}.
  21. *
  22. * @inheritdoc
  23. */
  24. render() {
  25. // Propagate all props of this Avatar but the ones consumed by this
  26. // Avatar to the img it renders.
  27. // eslint-disable-next-line no-unused-vars
  28. const { uri, ...props } = this.props;
  29. return (
  30. <img
  31. { ...props }
  32. src = { uri } />
  33. );
  34. }
  35. }