Created
December 30, 2016 18:59
-
-
Save ivportilla/f1db5dd357e789b03134d5f47fe47475 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { StyleSheet, View, Text, TextInput } from 'react-native'; | |
import Icon from 'react-native-vector-icons/MaterialIcons'; | |
const styles = StyleSheet.create({ | |
container: { | |
padding: 10, | |
}, | |
}); | |
const customTemplate = (locals) => { | |
const templateStyles = { | |
container: { | |
height: 72, | |
paddingVertical: 16, | |
justifyContent: 'center', | |
}, | |
label: { | |
fontSize: 12, | |
paddingBottom: 8, | |
}, | |
textInput: { | |
padding: 0, | |
margin: 0, | |
fontSize: 16, | |
color: '#555', | |
}, | |
inputContainer: { | |
flexDirection: 'row', | |
alignItems: 'center', | |
borderBottomWidth: 1, | |
borderColor: '#CCC', | |
paddingBottom: 8, | |
}, | |
icon: { | |
paddingHorizontal: 5, | |
}, | |
input: { | |
flex: 1, | |
}, | |
}; | |
return ( | |
<View style={templateStyles.container}> | |
<Text style={templateStyles.label}>{locals.label}</Text> | |
<View style={templateStyles.inputContainer}> | |
<View style={templateStyles.icon}> | |
<Icon name={'directions-car'} size={24} color={'grey'} /> | |
</View> | |
<View style={templateStyles.input}> | |
<TextInput | |
style={templateStyles.textInput} | |
autoCorrect={false} | |
underlineColorAndroid="rgba(0, 0, 0, 0)" | |
/> | |
</View> | |
</View> | |
</View> | |
); | |
}; | |
export { customTemplate }; | |
export default styles; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment