Created
March 5, 2020 17:51
-
-
Save bogoslavskiy/bb1ea0ab23fe72be19e14c4558fdf8ea to your computer and use it in GitHub Desktop.
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 * as React from "react"; | |
import { ViewStyle, StyleSheet, TextInputProps, View, TextInput } from "react-native"; | |
interface InputProps extends TextInputProps { | |
noWrapper?: boolean; | |
containerStyle?: ViewStyle; | |
} | |
export const Input = (props: InputProps) => { | |
const { noWrapper, containerStyle, ...other } = props; | |
return ( | |
<View style={[!noWrapper && styles.wrapper, containerStyle]}> | |
<View style={styles.container}> | |
<TextInput | |
{...other} | |
placeholderTextColor={'#8D8D8D'} | |
allowFontScaling={false} | |
selectionColor={'#007BFF'} | |
style={[props.style, styles.input]} | |
/> | |
</View> | |
</View> | |
); | |
}; | |
const styles = StyleSheet.create({ | |
container: { | |
borderRadius: 10, | |
backgroundColor: '#F2F3F5' | |
}, | |
wrapper: { | |
marginHorizontal: 16, | |
marginBottom: 16 | |
}, | |
input: { | |
fontSize: 17, | |
lineHeight: 22, | |
fontWeight: '400', | |
color: '#262626', | |
flexGrow: 1, | |
height: 54, | |
minHeight: 54, | |
paddingHorizontal: 16, | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment