InputComponent.js 1.02 KB
Newer Older
Giang Tran committed
1 2 3 4 5 6
import React from 'react';
import {View, Text, TextInput} from 'react-native';
import {HEIGHTXD, WIDTHXD, getFontXD} from '../../../Config/Functions';
import R from '../../../assets/R';

const InputComponent = (props) => {
Giang Tran committed
7
  const {title, onChangeText, maxLength, placeholder} = props;
Giang Tran committed
8 9 10 11 12 13 14 15 16 17 18 19

  return (
    <View style={{marginVertical: 5}}>
      <Text
        style={{
          fontSize: getFontXD(42),
          color: R.colors.color777,
          marginBottom: 5,
        }}>
        {title ? title : ''}
      </Text>
      <TextInput
Giang Tran committed
20
        placeholderTextColor={R.colors.placeHolder}
Giang Tran committed
21
        maxLength={maxLength}
Giang Tran committed
22
        placeholder={placeholder}
Giang Tran committed
23
        autoCapitalize="none"
Giang Tran committed
24
        onChangeText={(val) => onChangeText(val)}
Giang Tran committed
25 26 27 28 29 30 31
        style={{
          height: HEIGHTXD(89),
          borderRadius: 7,
          borderWidth: 0.7,
          borderColor: R.colors.borderGray,
          fontSize: getFontXD(42),
          padding: 5,
Giang Tran committed
32
          color: 'black',
Giang Tran committed
33 34 35 36 37 38
        }}
      />
    </View>
  );
};

Giang Tran committed
39
export default React.memo(InputComponent);