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.

LocalThumbnail.js 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { View } from 'react-native';
  4. import { getLocalParticipant } from '../../../base/participants';
  5. import { connect } from '../../../base/redux';
  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. export default connect(_mapStateToProps)(LocalThumbnail);