選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

BlankPage.js 1.2KB

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. * A React <tt>Component<tt> which represents a blank page. It renders 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 which prompted the introduction of this component is mobile
  11. * where SDK users probably disable the Welcome page.
  12. */
  13. class BlankPage extends Component {
  14. /**
  15. * {@code BlankPage} 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()(BlankPage);