{"size": 733, "ext": "js", "max_stars_repo_path": "app/presentation/TextInput.js", "max_stars_repo_name": "ankar84/Rocket.Chat.ReactNative", "max_stars_repo_stars_event_min_datetime": "2020-07-09T19:31:23.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-03T16:48:57.000Z", "max_issues_repo_path": "app/presentation/TextInput.js", "max_issues_repo_name": "ankar84/Rocket.Chat.ReactNative", "max_issues_repo_issues_event_min_datetime": "2020-07-16T14:57:48.000Z", "max_issues_repo_issues_event_max_datetime": "2020-07-23T13:58:27.000Z", "max_forks_repo_path": "app/presentation/TextInput.js", "max_forks_repo_name": "ankar84/Rocket.Chat.ReactNative", "max_forks_repo_forks_event_min_datetime": "2021-08-25T14:09:12.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-25T14:09:12.000Z"}
{"max_stars_count": 3, "max_issues_count": 4, "max_forks_count": 1, "avg_line_length": 23.6451612903, "max_line_length": 79, "alphanum_fraction": 0.6780354707}
import React from 'react';
import { TextInput, StyleSheet, I18nManager } from 'react-native';
import PropTypes from 'prop-types';

import { themes } from '../constants/colors';

const styles = StyleSheet.create({
	input: {
		...I18nManager.isRTL
			? { textAlign: 'right' }
			: { textAlign: 'left' }
	}
});

const ThemedTextInput = React.forwardRef(({ style, theme, ...props }, ref) => (
	<TextInput
		ref={ref}
		style={[{ color: themes[theme].titleText }, style, styles.input]}
		placeholderTextColor={themes[theme].auxiliaryText}
		keyboardAppearance={theme === 'light' ? 'light' : 'dark'}
		{...props}
	/>
));

ThemedTextInput.propTypes = {
	style: PropTypes.object,
	theme: PropTypes.string
};

export default ThemedTextInput;
