選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Avatar.native.js 865B

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