您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

LocalThumbnail.js 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { View } from 'react-native';
  4. import { connect } from 'react-redux';
  5. import { getLocalParticipant } from '../../../base/participants';
  6. import styles from '../styles';
  7. import Thumbnail from './Thumbnail';
  8. type Props = {
  9. /**
  10. * The local participant.
  11. */
  12. _localParticipant: Object
  13. };
  14. /**
  15. * Component to render a local thumbnail that can be separated from the
  16. * remote thumbnails later.
  17. */
  18. class LocalThumbnail extends Component<Props> {
  19. /**
  20. * Implements React Component's render.
  21. *
  22. * @inheritdoc
  23. */
  24. render() {
  25. const { _localParticipant } = this.props;
  26. return (
  27. <View style = { styles.localThumbnail }>
  28. <Thumbnail participant = { _localParticipant } />
  29. </View>
  30. );
  31. }
  32. }
  33. /**
  34. * Maps (parts of) the redux state to the associated {@code LocalThumbnail}'s
  35. * props.
  36. *
  37. * @param {Object} state - The redux state.
  38. * @private
  39. * @returns {{
  40. * _localParticipant: Participant
  41. * }}
  42. */
  43. function _mapStateToProps(state) {
  44. return {
  45. /**
  46. * The local participant.
  47. *
  48. * @private
  49. * @type {Participant}
  50. */
  51. _localParticipant: getLocalParticipant(state)
  52. };
  53. }
  54. // $FlowExpectedError
  55. export default connect(_mapStateToProps)(LocalThumbnail);