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.

CalleeInfoContainer.js 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { connect } from 'react-redux';
  4. import CalleeInfo from './CalleeInfo';
  5. /**
  6. * The type of the React {@code Component} props of {@code CalleeInfoContainer}.
  7. */
  8. type Props = {
  9. /**
  10. * The indicator which determines whether {@code CalleeInfo} is to be
  11. * rendered.
  12. *
  13. * @private
  14. */
  15. _calleeInfoVisible: boolean
  16. };
  17. /**
  18. * Implements a React {@link Component} which depicts the establishment of a
  19. * call with a specific remote callee if there is such a remote callee.
  20. *
  21. * @extends Component
  22. */
  23. class CalleeInfoContainer extends Component<Props> {
  24. /**
  25. * Implements React's {@link Component#render()}.
  26. *
  27. * @inheritdoc
  28. * @returns {ReactElement}
  29. */
  30. render() {
  31. return this.props._calleeInfoVisible ? <CalleeInfo /> : null;
  32. }
  33. }
  34. /**
  35. * Maps parts of the redux state to {@link CalleeInfoContainer} (React
  36. * {@code Component}) props.
  37. *
  38. * @param {Object} state - The redux state of which parts are to be mapped to
  39. * {@code CalleeInfoContainer} props.
  40. * @private
  41. * @returns {{
  42. * _calleeInfoVisible: boolean
  43. * }}
  44. */
  45. function _mapStateToProps(state: Object): Object {
  46. return {
  47. /**
  48. * The indicator which determines whether {@code CalleeInfo} is to be
  49. * rendered.
  50. *
  51. * @private
  52. * @type {boolean}
  53. */
  54. _calleeInfoVisible: state['features/invite'].calleeInfoVisible
  55. };
  56. }
  57. // $FlowExpectedError
  58. export default connect(_mapStateToProps)(CalleeInfoContainer);