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

123456789101112131415161718192021222324252627282930313233343536373839
  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. * Avatar component's property types.
  10. *
  11. * @static
  12. */
  13. static propTypes = {
  14. /**
  15. * The optional style to add to an Avatar in order to customize its base
  16. * look (and feel).
  17. */
  18. style: React.PropTypes.object,
  19. uri: React.PropTypes.string
  20. }
  21. /**
  22. * Implements React's {@link Component#render()}.
  23. *
  24. * @inheritdoc
  25. */
  26. render() {
  27. return (
  28. <Image
  29. // XXX Avatar is expected to display the whole image.
  30. resizeMode = 'contain'
  31. source = {{ uri: this.props.uri }}
  32. style = { [ styles.avatar, this.props.style ] } />
  33. );
  34. }
  35. }