您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

WelcomePage.native.js 3.9KB

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