normal_input.tsx 883 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import React from "react";
  2. import { TextInput, StyleSheet, StyleProp, ViewStyle, KeyboardTypeOptions } from "react-native";
  3. interface NormalInputProps {
  4. placeholder: string;
  5. extendedStyle?: StyleProp<ViewStyle>;
  6. onChangeText: (text: string) => void;
  7. type?: KeyboardTypeOptions;
  8. secureTextEntry?: boolean;
  9. }
  10. const NormalInput: React.FC<NormalInputProps> = ({
  11. placeholder,
  12. extendedStyle,
  13. type,
  14. onChangeText,
  15. secureTextEntry = false,
  16. }) => {
  17. return (
  18. <TextInput
  19. style={[styles.textInput, extendedStyle]}
  20. placeholder={placeholder}
  21. keyboardType={type ? type : "default"}
  22. onChangeText={onChangeText}
  23. secureTextEntry={secureTextEntry}
  24. />
  25. );
  26. };
  27. const styles = StyleSheet.create({
  28. textInput: {
  29. maxWidth: "100%",
  30. height: 60,
  31. borderWidth: 1,
  32. margin: 10,
  33. padding: 20,
  34. borderRadius: 8,
  35. borderColor: "#bbbbbb",
  36. },
  37. });
  38. export default NormalInput;