verdnatura-chat/app/presentation/TextInput.js

23 lines
563 B
JavaScript
Raw Normal View History

2019-12-04 16:39:53 +00:00
import React from 'react';
import { TextInput } from 'react-native';
import PropTypes from 'prop-types';
import { themes } from '../constants/colors';
const ThemedTextInput = React.forwardRef(({ style, theme, ...props }, ref) => (
<TextInput
ref={ref}
style={[{ color: themes[theme].titleText }, style]}
placeholderTextColor={themes[theme].auxiliaryText}
keyboardAppearance={theme === 'light' ? 'light' : 'dark'}
{...props}
/>
));
ThemedTextInput.propTypes = {
style: PropTypes.object,
theme: PropTypes.string
};
export default ThemedTextInput;