AppLoading/AppText/AppTextInput/Button/FramedSegment/Link -> ./common

This commit is contained in:
mashazyu
2020-03-22 17:18:28 +01:00
committed by Sofiya Tepikin
parent d3e795a51f
commit 1fc7bc17b9
37 changed files with 46 additions and 46 deletions
+30
View File
@@ -0,0 +1,30 @@
import React from 'react'
import PropTypes from 'prop-types'
import { TextInput } from 'react-native'
import styles from '../../styles'
export default function AppTextInput({ style, ...props }) {
if (!Array.isArray(style)) style = [style]
return (
<TextInput
style={[styles.textInputField, ...style]}
autoFocus={props.autoFocus}
onChangeText={props.onChangeText}
value={props.value}
placeholder={props.placeholder}
{...props}
/>
)
}
AppTextInput.propTypes = {
autoFocus: PropTypes.bool,
onChangeText: PropTypes.func,
placeholder: PropTypes.string,
style: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
value: PropTypes.string,
}
AppTextInput.defaultProps = {
style: []
}