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.

FilmStrip.js 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import React, { Component } from 'react';
  2. import { connect } from 'react-redux';
  3. import { Container } from '../../base/react';
  4. import Thumbnail from './Thumbnail';
  5. import { styles } from './_';
  6. /**
  7. * React component for film strip.
  8. *
  9. * @extends Component
  10. */
  11. class FilmStrip extends Component {
  12. /**
  13. * Implements React's {@link Component#render()}.
  14. *
  15. * @inheritdoc
  16. */
  17. render() {
  18. return (
  19. <Container
  20. style = { styles.filmStrip }
  21. visible = { this.props.visible }>
  22. {
  23. this.props.participants
  24. .sort((a, b) => b.local - a.local)
  25. .map(p =>
  26. <Thumbnail
  27. key = { p.id }
  28. participant = { p } />)
  29. }
  30. </Container>
  31. );
  32. }
  33. }
  34. /**
  35. * FilmStrip component's property types.
  36. *
  37. * @static
  38. */
  39. FilmStrip.propTypes = {
  40. participants: React.PropTypes.array,
  41. visible: React.PropTypes.bool.isRequired
  42. };
  43. /**
  44. * Function that maps parts of Redux state tree into component props.
  45. *
  46. * @param {Object} state - Redux state.
  47. * @returns {{
  48. * participants: Participant[],
  49. * tracks: (JitsiLocalTrack|JitsiRemoteTrack)[]
  50. * }}
  51. */
  52. function mapStateToProps(state) {
  53. return {
  54. participants: state['features/base/participants']
  55. };
  56. }
  57. export default connect(mapStateToProps)(FilmStrip);