Skip to content
Snippets Groups Projects
Commit 3de92b9f authored by mashazyu's avatar mashazyu Committed by Sofiya Tepikin
Browse files

Moves unique styles of AppTextInput to local file and does some cleanup

parent 652bc1ff
No related branches found
No related tags found
No related merge requests found
...@@ -2,24 +2,22 @@ import React from 'react' ...@@ -2,24 +2,22 @@ import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { StyleSheet, TextInput } from 'react-native' import { StyleSheet, TextInput } from 'react-native'
import { Containers } from '../../styles/redesign' import { Colors } from '../../styles/redesign'
const AppTextInput = ({ const AppTextInput = ({
autoFocus, autoFocus,
onChangeText, onChangeText,
placeholder, placeholder,
value, value,
style,
...props ...props
}) => { }) => {
if (!Array.isArray(style)) style = [style]
return ( return (
<TextInput <TextInput
autoFocus={autoFocus} autoFocus={autoFocus}
onChangeText={onChangeText} onChangeText={onChangeText}
placeholder={placeholder} placeholder={placeholder}
style={[styles.input, ...style]} style={styles.input}
value={value} value={value}
{...props} {...props}
/> />
...@@ -30,17 +28,15 @@ AppTextInput.propTypes = { ...@@ -30,17 +28,15 @@ AppTextInput.propTypes = {
autoFocus: PropTypes.bool, autoFocus: PropTypes.bool,
onChangeText: PropTypes.func, onChangeText: PropTypes.func,
placeholder: PropTypes.string, placeholder: PropTypes.string,
style: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
value: PropTypes.string, value: PropTypes.string,
} }
AppTextInput.defaultProps = {
style: []
}
const styles = StyleSheet.create({ const styles = StyleSheet.create({
input: { input: {
...Containers.greyBorder borderColor: Colors.grey,
borderRadius: 5,
borderStyle: 'solid',
borderWidth: 1,
} }
}) })
......
...@@ -6,12 +6,6 @@ export default { ...@@ -6,12 +6,6 @@ export default {
flex: 1, flex: 1,
justifyContent: 'center' justifyContent: 'center'
}, },
greyBorder: {
borderColor: Colors.grey,
borderRadius: 5,
borderStyle: 'solid',
borderWidth: 1,
},
page: { page: {
backgroundColor: Colors.tourquiseLight, backgroundColor: Colors.tourquiseLight,
flex: 1 flex: 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment