forked from adrianhajdin/uber
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputField.tsx
More file actions
52 lines (49 loc) · 1.33 KB
/
InputField.tsx
File metadata and controls
52 lines (49 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import {
TextInput,
View,
Text,
Image,
KeyboardAvoidingView,
TouchableWithoutFeedback,
Keyboard,
Platform,
} from "react-native";
import { InputFieldProps } from "@/types/type";
const InputField = ({
label,
icon,
secureTextEntry = false,
labelStyle,
containerStyle,
inputStyle,
iconStyle,
className,
...props
}: InputFieldProps) => {
return (
<KeyboardAvoidingView
behavior={Platform.OS === "ios" ? "padding" : "height"}
>
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
<View className="my-2 w-full">
<Text className={`text-lg font-JakartaSemiBold mb-3 ${labelStyle}`}>
{label}
</Text>
<View
className={`flex flex-row justify-start items-center relative bg-neutral-100 rounded-full border border-neutral-100 focus:border-primary-500 ${containerStyle}`}
>
{icon && (
<Image source={icon} className={`w-6 h-6 ml-4 ${iconStyle}`} />
)}
<TextInput
className={`rounded-full p-4 font-JakartaSemiBold text-[15px] flex-1 ${inputStyle} text-left`}
secureTextEntry={secureTextEntry}
{...props}
/>
</View>
</View>
</TouchableWithoutFeedback>
</KeyboardAvoidingView>
);
};
export default InputField;