Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dmitryshelomanov/a64500a5af392af1302d2aa028102a4c to your computer and use it in GitHub Desktop.
Save dmitryshelomanov/a64500a5af392af1302d2aa028102a4c to your computer and use it in GitHub Desktop.
text-field.js
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