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

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