Created
October 17, 2018 10:54
-
-
Save dmitryshelomanov/a64500a5af392af1302d2aa028102a4c to your computer and use it in GitHub Desktop.
text-field.js
This file contains hidden or 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 { Input, Item, Label } from 'native-base' | |
import { StyleSheet } from 'react-native' | |
export const StackedTextField = ({ | |
innerRef = () => {}, | |
label, | |
onPress, | |
inputContainerStyle, | |
fieldWrapperStyle, | |
...props | |
}) => ( | |
<Item | |
onPress={onPress} | |
stackedLabel | |
style={[ | |
styles.wrapper, | |
fieldWrapperStyle && fieldWrapperStyle, | |
]} | |
> | |
<Label>{label}</Label> | |
<Input | |
ref={innerRef} | |
style={[ | |
styles.input, | |
inputContainerStyle && inputContainerStyle, | |
]} | |
{...props} | |
/> | |
</Item> | |
) | |
const styles = StyleSheet.create({ | |
wrapper: { | |
marginLeft: 0, | |
paddingLeft: 0, | |
}, | |
input: { | |
marginLeft: 0, | |
paddingLeft: 0, | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment