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.

Landing.js 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import React, { Component } from 'react';
  2. import { Link } from 'react-router';
  3. import { connect } from 'react-redux';
  4. import { landingIsShown } from '../actions';
  5. const links = {
  6. 'android': 'https://play.google.com/store/apps/details?id=org.jitsi.meet',
  7. 'ios': ''
  8. };
  9. /**
  10. * React component representing mobile landing page.
  11. *
  12. * @class Landing
  13. */
  14. class Landing extends Component {
  15. /**
  16. * React lifecycle method triggered after
  17. * component is mount.
  18. *
  19. * @returns {void}
  20. */
  21. componentDidMount() {
  22. this.props.dispatch(landingIsShown());
  23. }
  24. static propTypes = {
  25. dispatch: React.PropTypes.func,
  26. location: React.PropTypes.object
  27. };
  28. /**
  29. * React lifecycle method triggered before
  30. * component will mount.
  31. *
  32. * @returns {void}
  33. */
  34. componentWillMount() {
  35. const { query } = this.props.location;
  36. const { conferenceName, platform } = query;
  37. let btnText;
  38. let link = '/';
  39. if (conferenceName) {
  40. btnText = 'Join the conversation';
  41. link += conferenceName;
  42. } else {
  43. btnText = 'Start a conference';
  44. }
  45. this.setState({
  46. btnText,
  47. link,
  48. platform
  49. });
  50. }
  51. /**
  52. * Renders landing component.
  53. *
  54. * @returns {ReactElement}
  55. */
  56. render() {
  57. const { btnText, link, platform } = this.state;
  58. const primaryButtonClasses = 'landing__button landing__button_primary';
  59. return (
  60. <div className = 'landing'>
  61. <div className = 'landing__body'>
  62. <img
  63. className = 'landing__logo'
  64. src = '/images/logo-blue.svg' />
  65. <p className = 'landing__text'>
  66. You need <strong>Meet Jitsi</strong>
  67. to join a conversation on your mobile
  68. </p>
  69. <a href = { links[platform] }>
  70. <button
  71. className = { primaryButtonClasses }>
  72. Download the App
  73. </button>
  74. </a>
  75. <p className = 'landing__text landing__text_small'>
  76. or if you already have it
  77. <br /><strong>then</strong>
  78. </p>
  79. <Link to = { link }>
  80. <button
  81. className = 'landing__button'>{ btnText }</button>
  82. </Link>
  83. </div>
  84. </div>
  85. );
  86. }
  87. }
  88. export default connect()(Landing);