Hangry/app/components/Public/commonTextInput.js

54 lines
1.6 KiB
JavaScript
Raw Normal View History

2024-02-27 16:19:55 +08:00
import React from "react";
import { TextInput, View } from "react-native";
import { scale, verticalScale, moderateScale } from "react-native-size-matters";
import Size from "../../config/size";
const size = new Size();
import theme from "../../config/colors";
import { width, height } from "../../config/screen";
import {Fonts} from "../../config/fonts"
const CommonTextInput = props => {
return (
<View
style={{
backgroundColor: theme.inputBgc,
marginLeft: 20,
marginRight: 20,
marginTop: 30,
height: verticalScale(40),
borderRadius:5
}}
>
<TextInput
style={{
// backgroundColor:theme.inputBgc,
color: theme.foodNameColor,
height: verticalScale(35),
marginBottom: moderateScale(30),
paddingBottom:0,
fontSize: size.getSize(15),
paddingRight: 20,
paddingLeft: 20,
fontFamily:Fonts.century
}}
key = {props.key}
value={props.value}
underlineColorAndroid="rgba(0,0,0,0)"
onChangeText={props.onChangeText}
placeholder={props.placeholder}
placeholderStyle={{fontWeight: 'bold', fontFamily:Fonts.century}}
placeholderTextColor = {theme.foodNameColor}
secureTextEntry={props.secureTextEntry}
blurOnSubmit={false}
{...props}
ref={(input) => props.inputRef && props.inputRef(input)}
returnKeyType = {props.returnKeyType}
onSubmitEditing = {props.onSubmitEditing && props.onSubmitEditing}
onFocus={props.onFocus}
/>
</View>
);
};
export default CommonTextInput;