Moves unique styles of AppTextInput to local file and does some cleanup
This commit is contained in:
@@ -2,24 +2,22 @@ import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { StyleSheet, TextInput } from 'react-native'
|
||||
|
||||
import { Containers } from '../../styles/redesign'
|
||||
import { Colors } from '../../styles/redesign'
|
||||
|
||||
const AppTextInput = ({
|
||||
autoFocus,
|
||||
onChangeText,
|
||||
placeholder,
|
||||
value,
|
||||
style,
|
||||
...props
|
||||
}) => {
|
||||
if (!Array.isArray(style)) style = [style]
|
||||
|
||||
return (
|
||||
<TextInput
|
||||
autoFocus={autoFocus}
|
||||
onChangeText={onChangeText}
|
||||
placeholder={placeholder}
|
||||
style={[styles.input, ...style]}
|
||||
style={styles.input}
|
||||
value={value}
|
||||
{...props}
|
||||
/>
|
||||
@@ -30,17 +28,15 @@ AppTextInput.propTypes = {
|
||||
autoFocus: PropTypes.bool,
|
||||
onChangeText: PropTypes.func,
|
||||
placeholder: PropTypes.string,
|
||||
style: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
|
||||
value: PropTypes.string,
|
||||
}
|
||||
|
||||
AppTextInput.defaultProps = {
|
||||
style: []
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
input: {
|
||||
...Containers.greyBorder
|
||||
borderColor: Colors.grey,
|
||||
borderRadius: 5,
|
||||
borderStyle: 'solid',
|
||||
borderWidth: 1,
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user