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.

BlankWelcomePage.js 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import PropTypes from 'prop-types';
  2. import { Component } from 'react';
  3. import { connect } from 'react-redux';
  4. import { destroyLocalTracks } from '../../base/tracks';
  5. /**
  6. * Component for rendering a blank welcome page. It renders absolutely nothing
  7. * and destroys local tracks upon being mounted, since no media is desired when
  8. * this component is rendered.
  9. *
  10. * The use case is mainly mobile, where SDK users probably disable the welcome
  11. * page, but using it on the web in the future is not out of the question.
  12. */
  13. class BlankWelcomePage extends Component {
  14. /**
  15. * {@code BlankWelcomePage} component's property types.
  16. *
  17. * @static
  18. */
  19. static propTypes = {
  20. dispatch: PropTypes.func
  21. };
  22. /**
  23. * Destroys the local tracks (if any) since no media is desired when this
  24. * component is rendered.
  25. *
  26. * @inheritdoc
  27. * @returns {void}
  28. */
  29. componentWillMount() {
  30. this.props.dispatch(destroyLocalTracks());
  31. }
  32. /**
  33. * Implements React's {@link Component#render()}. In this particular case
  34. * we return null, because the entire purpose of this component is to render
  35. * nothing.
  36. *
  37. * @inheritdoc
  38. * @returns {null}
  39. */
  40. render() {
  41. return null;
  42. }
  43. }
  44. export default connect()(BlankWelcomePage);