import React from 'react'; import { View, Text, StyleSheet, I18nManager } from 'react-native'; import PropTypes from 'prop-types'; import Touch from '../../utils/touch'; import { themes } from '../../constants/colors'; import sharedStyles from '../../views/Styles'; import { withTheme } from '../../theme'; import I18n from '../../i18n'; import { Icon } from '.'; import { BASE_HEIGHT, PADDING_HORIZONTAL } from './constants'; import { withDimensions } from '../../dimensions'; const styles = StyleSheet.create({ container: { flex: 1, flexDirection: 'row', alignItems: 'center', justifyContent: 'center', paddingHorizontal: PADDING_HORIZONTAL }, leftContainer: { paddingRight: PADDING_HORIZONTAL }, rightContainer: { paddingLeft: PADDING_HORIZONTAL }, disabled: { opacity: 0.3 }, textContainer: { flex: 1, justifyContent: 'center' }, title: { fontSize: 16, ...sharedStyles.textRegular }, subtitle: { fontSize: 14, ...sharedStyles.textRegular }, actionIndicator: { ...I18nManager.isRTL ? { transform: [{ rotate: '180deg' }] } : {} } }); const Content = React.memo(({ title, subtitle, disabled, testID, left, right, color, theme, translateTitle, translateSubtitle, showActionIndicator, fontScale }) => ( {left ? ( {left()} ) : null} {translateTitle ? I18n.t(title) : title} {subtitle ? {translateSubtitle ? I18n.t(subtitle) : subtitle} : null } {right || showActionIndicator ? ( {right ? right() : null} {showActionIndicator ? : null} ) : null} )); const Button = React.memo(({ onPress, ...props }) => ( onPress(props.title)} style={{ backgroundColor: themes[props.theme].backgroundColor }} enabled={!props.disabled} theme={props.theme} > )); const ListItem = React.memo(({ ...props }) => { if (props.onPress) { return