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.native.js 870B

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