Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

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