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 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 terms and conditions (of service) are available to the
  10. * user.
  11. */
  12. const TERMS_AND_CONDITIONS_URL = 'https://jitsi.org/meet/terms';
  13. /**
  14. * The native container rendering the welcome page.
  15. *
  16. * @extends AbstractWelcomePage
  17. */
  18. class WelcomePage extends AbstractWelcomePage {
  19. /**
  20. * WelcomePage component's property types.
  21. *
  22. * @static
  23. */
  24. static propTypes = AbstractWelcomePage.propTypes
  25. /**
  26. * Renders a prompt for entering a room name.
  27. *
  28. * @returns {ReactElement}
  29. */
  30. render() {
  31. return (
  32. <View style = { styles.container }>
  33. {
  34. this._renderLocalVideo()
  35. }
  36. {
  37. this._renderLocalVideoOverlay()
  38. }
  39. </View>
  40. );
  41. }
  42. /**
  43. * Renders a View over the local video. The latter is thought of as the
  44. * background (content) of this WelcomePage. The former is thought of as the
  45. * foreground (content) of this WelcomePage such as the room name input, the
  46. * button to initiate joining the specified room, etc.
  47. *
  48. * @private
  49. * @returns {ReactElement}
  50. */
  51. _renderLocalVideoOverlay() {
  52. return (
  53. <View style = { styles.localVideoOverlay }>
  54. <View style = { styles.roomContainer }>
  55. <Text style = { styles.title }>Enter room name</Text>
  56. <TextInput
  57. autoCapitalize = 'none'
  58. autoCorrect = { false }
  59. autoFocus = { true }
  60. onChangeText = { this._onRoomChange }
  61. placeholder = 'room name'
  62. style = { styles.textInput }
  63. value = { this.state.room } />
  64. <TouchableHighlight
  65. disabled = { this._isJoinDisabled() }
  66. onPress = { this._onJoinClick }
  67. style = { styles.button }
  68. underlayColor = { ColorPalette.white }>
  69. <Text style = { styles.buttonText }>JOIN</Text>
  70. </TouchableHighlight>
  71. </View>
  72. <View style = { styles.legaleseContainer }>
  73. <Link
  74. style = { styles.legaleseItem }
  75. url = { TERMS_AND_CONDITIONS_URL }>
  76. Terms and Conditions
  77. </Link>
  78. </View>
  79. </View>
  80. );
  81. }
  82. }
  83. export default connect(mapStateToProps)(WelcomePage);