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.

WelcomePage.native.js 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. import React from 'react';
  2. import { TextInput, TouchableHighlight, View } from 'react-native';
  3. import { connect } from 'react-redux';
  4. import { translate } from '../../base/i18n';
  5. import { MEDIA_TYPE } from '../../base/media';
  6. import { Link, Text } from '../../base/react';
  7. import { ColorPalette } from '../../base/styles';
  8. import { createDesiredLocalTracks } from '../../base/tracks';
  9. import { AbstractWelcomePage, _mapStateToProps } from './AbstractWelcomePage';
  10. import LocalVideoTrackUnderlay from './LocalVideoTrackUnderlay';
  11. import styles from './styles';
  12. /**
  13. * The URL at which the privacy policy is available to the user.
  14. */
  15. const PRIVACY_URL = 'https://jitsi.org/meet/privacy';
  16. /**
  17. * The URL at which the user may send feedback.
  18. */
  19. const SEND_FEEDBACK_URL = 'mailto:support@jitsi.org';
  20. /**
  21. * The URL at which the terms (of service/use) are available to the user.
  22. */
  23. const TERMS_URL = 'https://jitsi.org/meet/terms';
  24. /**
  25. * The native container rendering the welcome page.
  26. *
  27. * @extends AbstractWelcomePage
  28. */
  29. class WelcomePage extends AbstractWelcomePage {
  30. /**
  31. * WelcomePage component's property types.
  32. *
  33. * @static
  34. */
  35. static propTypes = AbstractWelcomePage.propTypes;
  36. /**
  37. * Creates a video track if not already available.
  38. *
  39. * @inheritdoc
  40. * @returns {void}
  41. */
  42. componentWillMount() {
  43. this.props.dispatch(createDesiredLocalTracks(MEDIA_TYPE.VIDEO));
  44. }
  45. /**
  46. * Renders a prompt for entering a room name.
  47. *
  48. * @returns {ReactElement}
  49. */
  50. render() {
  51. const { t } = this.props;
  52. return (
  53. <LocalVideoTrackUnderlay style = { styles.welcomePage }>
  54. <View style = { styles.roomContainer }>
  55. <Text style = { styles.title }>
  56. { t('welcomepage.roomname') }
  57. </Text>
  58. <TextInput
  59. accessibilityLabel = { 'Input room name.' }
  60. autoCapitalize = 'none'
  61. autoComplete = { false }
  62. autoCorrect = { false }
  63. autoFocus = { false }
  64. onChangeText = { this._onRoomChange }
  65. placeholder = { t('welcomepage.roomnamePlaceHolder') }
  66. style = { styles.textInput }
  67. underlineColorAndroid = 'transparent'
  68. value = { this.state.room } />
  69. <TouchableHighlight
  70. accessibilityLabel = { 'Tap to Join.' }
  71. disabled = { this._isJoinDisabled() }
  72. onPress = { this._onJoin }
  73. style = { styles.button }
  74. underlayColor = { ColorPalette.white }>
  75. <Text style = { styles.buttonText }>
  76. { t('welcomepage.join') }
  77. </Text>
  78. </TouchableHighlight>
  79. </View>
  80. {
  81. this._renderLegalese()
  82. }
  83. </LocalVideoTrackUnderlay>
  84. );
  85. }
  86. /**
  87. * Renders legal-related content such as Terms of service/use, Privacy
  88. * policy, etc.
  89. *
  90. * @private
  91. * @returns {ReactElement}
  92. */
  93. _renderLegalese() {
  94. const { t } = this.props;
  95. return (
  96. <View style = { styles.legaleseContainer }>
  97. <Link
  98. style = { styles.legaleseItem }
  99. url = { TERMS_URL }>
  100. { t('welcomepage.terms') }
  101. </Link>
  102. <Link
  103. style = { styles.legaleseItem }
  104. url = { PRIVACY_URL }>
  105. { t('welcomepage.privacy') }
  106. </Link>
  107. <Link
  108. style = { styles.legaleseItem }
  109. url = { SEND_FEEDBACK_URL }>
  110. { t('welcomepage.sendFeedback') }
  111. </Link>
  112. </View>
  113. );
  114. }
  115. }
  116. export default translate(connect(_mapStateToProps)(WelcomePage));