diff --git a/src/components/Input/index.ts b/src/components/Input/index.ts deleted file mode 100644 index b4d3864..0000000 --- a/src/components/Input/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as Input } from './Input'; diff --git a/src/components/Input/Input.tsx b/src/components/TextInput/TextInput.tsx similarity index 79% rename from src/components/Input/Input.tsx rename to src/components/TextInput/TextInput.tsx index cc3da98..ad0fd6a 100644 --- a/src/components/Input/Input.tsx +++ b/src/components/TextInput/TextInput.tsx @@ -1,29 +1,33 @@ import React from 'react'; -import { StyleSheet, Text, TextInput, View } from 'react-native'; +import { + StyleSheet, + Text, + TextInput as ReactTextInput, + View, +} from 'react-native'; import { useTheme } from '@/hooks'; -type Props = React.ComponentPropsWithRef & { +type Props = React.ComponentPropsWithRef & { label: string; secureTextEntry?: boolean; onSubmit: (text: string) => void; }; -const Input = ({ ...props }: Props) => { +const TextInput = ({ ...props }: Props) => { const { themedStyles } = useTheme(); return ( {props.label} - props.onSubmit(value.nativeEvent.text)} /> @@ -50,4 +54,4 @@ const styles = StyleSheet.create({ }, }); -export default Input; +export default TextInput; diff --git a/src/components/TextInput/index.ts b/src/components/TextInput/index.ts new file mode 100644 index 0000000..137a144 --- /dev/null +++ b/src/components/TextInput/index.ts @@ -0,0 +1 @@ +export { default as TextInput } from './TextInput'; diff --git a/src/screens/Components.tsx b/src/screens/Components.tsx index 8eeee48..bb81de8 100644 --- a/src/screens/Components.tsx +++ b/src/screens/Components.tsx @@ -5,7 +5,7 @@ import { globalStyles } from 'style'; import { SwitchTheme } from '@/components'; import { PrimaryButton } from '@/components/Button'; -import { Input } from '@/components/Input'; +import { TextInput } from '@/components/TextInput'; import { RootStackParamList } from '@/types/param'; type Props = NativeStackScreenProps; @@ -14,7 +14,7 @@ const Home = ({ navigation }: Props) => { return ( Components screen - console.log(text)}