UNPKG

mfrag38-react-native-textinput-with-icons-full

Version:

small react native package help you to make a material text input and allow you to add icons to the left and right side and icons have onPress feature

43 lines (39 loc) 874 B
import React, { Component } from 'react'; import { Text } from 'react-native'; import PropTypes from 'prop-types'; export default class extends Component { static propTypes = { error: PropTypes.string, errorPaddingTop: PropTypes.number, errorColor: PropTypes.string, errorBackgroundColor: PropTypes.string, errorFontSize: PropTypes.number, }; static defaultProps = { errorPaddingTop: 8, errorBackgroundColor: 'transparent', errorColor: '#fc1f4a', errorFontSize: 12, }; render() { const { error, errorPaddingTop, errorColor, errorBackgroundColor, errorFontSize, } = this.props; return ( <Text style={{ backgroundColor: errorBackgroundColor, paddingTop: errorPaddingTop, color: errorColor, fontSize: errorFontSize, }} > {error} </Text> ); } }