forked from cemaden-educacao/WPD-MobileApp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
996 B
42 lines
996 B
import React from "react";
|
|
import { View, TextInput, StyleSheet } from "react-native";
|
|
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
|
import colors from "../config/colors";
|
|
import defaultStyles from "../config/styles";
|
|
|
|
function AppTextInput({ icon, width = "100%", ...otherProps }) {
|
|
return (
|
|
<View style={[styles.container, { width }]}>
|
|
{icon && (
|
|
<MaterialCommunityIcons
|
|
name={icon}
|
|
size={20}
|
|
color={defaultStyles.colors.medium}
|
|
style={styles.icon}
|
|
/>
|
|
)}
|
|
<TextInput
|
|
style={defaultStyles.text}
|
|
placeholderTextColor={colors.medium}
|
|
{...otherProps}
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
backgroundColor: colors.white,
|
|
borderRadius: 6,
|
|
borderColor: colors.medium,
|
|
borderWidth: 1,
|
|
padding: 10,
|
|
flexDirection: "row",
|
|
marginVertical: 10,
|
|
},
|
|
icon: {
|
|
marginRight: 10,
|
|
},
|
|
});
|
|
|
|
export default AppTextInput;
|