import React from 'react'; import { TextInput, TouchableOpacity, Text, View } from 'react-native'; import PropTypes from 'prop-types'; import { Color } from '../../config/Color'; import { Typography } from '../../config/typography'; export default function Index(props) { const cardColor = Color.cardBackgroundColor; const { style, onChangeText, onFocus, placeholder, value, success, secureTextEntry, keyboardType, textAlignVertical, label, onSubmitEditing, borderBottomColor, icon } = props; return ( {!!label && {label}} onChangeText(text)} onFocus={() => onFocus()} textAlignVertical={textAlignVertical} onSubmitEditing={onSubmitEditing} /> {icon} ); } Index.propTypes = { style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), onChangeText: PropTypes.func, onFocus: PropTypes.func, placeholder: PropTypes.string, value: PropTypes.string, success: PropTypes.bool, label: PropTypes.string, secureTextEntry: PropTypes.bool, keyboardType: PropTypes.string, textAlignVertical: PropTypes.string, icon: PropTypes.node, onSubmitEditing: PropTypes.func, }; Index.defaultProps = { style: {}, onChangeText: text => { }, onFocus: () => { }, placeholder: 'Placeholder', value: '', label: '', borderBottomColor: "black", success: true, secureTextEntry: false, keyboardType: 'default', textAlignVertical: 'center', icon: null, onSubmitEditing: () => { }, };