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.

AppSettings.native.js 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import React from 'react';
  2. import {
  3. Modal,
  4. Switch,
  5. Text,
  6. TextInput,
  7. View } from 'react-native';
  8. import { connect } from 'react-redux';
  9. import {
  10. _mapStateToProps,
  11. AbstractAppSettings
  12. } from './AbstractAppSettings';
  13. import FormRow from './FormRow';
  14. import styles from './styles';
  15. import { translate } from '../../base/i18n';
  16. /**
  17. * The native container rendering the app settings page.
  18. *
  19. * @extends AbstractAppSettings
  20. */
  21. class AppSettings extends AbstractAppSettings {
  22. /**
  23. * Implements React's {@link Component#render()}, renders the settings page.
  24. *
  25. * @inheritdoc
  26. * @returns {ReactElement}
  27. */
  28. render() {
  29. const { t } = this.props;
  30. return (
  31. <Modal
  32. animationType = 'slide'
  33. onRequestClose = { this._onRequestClose }
  34. presentationStyle = 'fullScreen'
  35. style = { styles.modal }
  36. visible = { this.props._visible }>
  37. <View style = { styles.headerContainer } >
  38. <Text style = { [ styles.text, styles.headerTitle ] } >
  39. { t('profileModal.header') }
  40. </Text>
  41. </View>
  42. <View style = { styles.settingsContainer } >
  43. <FormRow
  44. fieldSeparator = { true }
  45. i18nLabel = 'profileModal.serverURL' >
  46. <TextInput
  47. autoCapitalize = 'none'
  48. onChangeText = { this._onChangeServerName }
  49. onEndEditing = { this._onSaveServerName }
  50. placeholder = 'https://jitsi.example.com'
  51. value = { this.state.serverURL } />
  52. </FormRow>
  53. <FormRow
  54. fieldSeparator = { true }
  55. i18nLabel = 'profileModal.displayName' >
  56. <TextInput
  57. onChangeText = { this._onChangeDisplayName }
  58. onEndEditing = { this._onSaveDisplayName }
  59. placeholder = 'John Doe'
  60. value = { this.state.displayName } />
  61. </FormRow>
  62. <FormRow
  63. fieldSeparator = { true }
  64. i18nLabel = 'profileModal.email' >
  65. <TextInput
  66. onChangeText = { this._onChangeEmail }
  67. onEndEditing = { this._onSaveEmail }
  68. placeholder = 'email@example.com'
  69. value = { this.state.email } />
  70. </FormRow>
  71. <FormRow
  72. fieldSeparator = { true }
  73. i18nLabel = 'profileModal.startWithAudioMuted' >
  74. <Switch
  75. onValueChange = {
  76. this._onStartAudioMutedChange
  77. }
  78. value = { this.state.startWithAudioMuted } />
  79. </FormRow>
  80. <FormRow
  81. i18nLabel = 'profileModal.startWithVideoMuted' >
  82. <Switch
  83. onValueChange = {
  84. this._onStartVideoMutedChange
  85. }
  86. value = { this.state.startWithVideoMuted } />
  87. </FormRow>
  88. </View>
  89. </Modal>
  90. );
  91. }
  92. }
  93. export default translate(connect(_mapStateToProps)(AppSettings));