| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 | import React from 'react';
import {
    Modal,
    Switch,
    Text,
    TextInput,
    View } from 'react-native';
import { connect } from 'react-redux';
import {
    _mapStateToProps,
    AbstractAppSettings
} from './AbstractAppSettings';
import FormRow from './FormRow';
import styles from './styles';
import { translate } from '../../base/i18n';
/**
 * The native container rendering the app settings page.
 *
 * @extends AbstractAppSettings
 */
class AppSettings extends AbstractAppSettings {
    /**
     * Implements React's {@link Component#render()}, renders the settings page.
     *
     * @inheritdoc
     * @returns {ReactElement}
     */
    render() {
        const { t } = this.props;
        return (
            <Modal
                animationType = 'slide'
                onRequestClose = { this._onRequestClose }
                presentationStyle = 'fullScreen'
                style = { styles.modal }
                visible = { this.props._visible }>
                <View style = { styles.headerContainer } >
                    <Text style = { [ styles.text, styles.headerTitle ] } >
                        { t('profileModal.header') }
                    </Text>
                </View>
                <View style = { styles.settingsContainer } >
                    <FormRow
                        fieldSeparator = { true }
                        i18nLabel = 'profileModal.serverURL' >
                        <TextInput
                            autoCapitalize = 'none'
                            onChangeText = { this._onChangeServerName }
                            onEndEditing = { this._onSaveServerName }
                            placeholder = 'https://jitsi.example.com'
                            value = { this.state.serverURL } />
                    </FormRow>
                    <FormRow
                        fieldSeparator = { true }
                        i18nLabel = 'profileModal.displayName' >
                        <TextInput
                            onChangeText = { this._onChangeDisplayName }
                            onEndEditing = { this._onSaveDisplayName }
                            placeholder = 'John Doe'
                            value = { this.state.displayName } />
                    </FormRow>
                    <FormRow
                        fieldSeparator = { true }
                        i18nLabel = 'profileModal.email' >
                        <TextInput
                            keyboardType = { 'email-address' }
                            onChangeText = { this._onChangeEmail }
                            onEndEditing = { this._onSaveEmail }
                            placeholder = 'email@example.com'
                            value = { this.state.email } />
                    </FormRow>
                    <FormRow
                        fieldSeparator = { true }
                        i18nLabel = 'profileModal.startWithAudioMuted' >
                        <Switch
                            onValueChange = {
                                this._onStartAudioMutedChange
                            }
                            value = { this.state.startWithAudioMuted } />
                    </FormRow>
                    <FormRow
                        i18nLabel = 'profileModal.startWithVideoMuted' >
                        <Switch
                            onValueChange = {
                                this._onStartVideoMutedChange
                            }
                            value = { this.state.startWithVideoMuted } />
                    </FormRow>
                </View>
            </Modal>
        );
    }
}
export default translate(connect(_mapStateToProps)(AppSettings));
 |