import React from 'react'; import { Modal, ScrollView, Switch, Text, TextInput, View } from 'react-native'; import { connect } from 'react-redux'; import { ASPECT_RATIO_NARROW } from '../../base/aspect-ratio'; import { translate } from '../../base/i18n'; import { isIPad } from '../../base/react'; import { _mapStateToProps, AbstractAppSettings } from './AbstractAppSettings'; import BackButton from './BackButton'; import FormRow from './FormRow'; import FormSectionHeader from './FormSectionHeader'; import { getSafetyOffset } from '../functions'; import styles, { HEADER_PADDING } from './styles'; /** * The native container rendering the app settings page. * * @extends AbstractAppSettings */ class AppSettings extends AbstractAppSettings { /** * Instantiates a new {@code AppSettings} instance. * * @inheritdoc */ constructor(props) { super(props); this._getSafetyPadding = this._getSafetyPadding.bind(this); } /** * Implements React's {@link Component#render()}, renders the settings page. * * @inheritdoc * @returns {ReactElement} */ render() { const { _profile, t } = this.props; // FIXME: presentationStyle is added to workaround orientation issue on // iOS return ( { t('profileModal.header') } ); } /** * Calculates header safety padding for mobile devices. See comment in * functions.js. * * @private * @returns {Object} */ _getSafetyPadding() { if (isIPad() || this.props._aspectRatio === ASPECT_RATIO_NARROW) { const safeOffset = Math.max(getSafetyOffset(), HEADER_PADDING); return { paddingTop: safeOffset }; } return undefined; } } export default translate(connect(_mapStateToProps)(AppSettings));