diff --git a/src/components/TextInput/TextInput.tsx b/src/components/TextInput/TextInput.tsx new file mode 100644 index 0000000..6e780a6 --- /dev/null +++ b/src/components/TextInput/TextInput.tsx @@ -0,0 +1,55 @@ +import React from 'react'; +import { + StyleSheet, + Text, + TextInput as ReactTextInput, + View, +} from 'react-native'; + +import { useTheme } from '@/hooks'; + +type Props = React.ComponentPropsWithRef & { + label: string; + secureTextEntry?: boolean; + onSubmit: (text: string) => void; +}; + +const TextInput = ({ label, secureTextEntry, onSubmit }: Props) => { + const { themedStyles } = useTheme(); + return ( + + {label} + onSubmit(value.nativeEvent.text)} + /> + + ); +}; + +const styles = StyleSheet.create({ + container: { + marginBottom: 10, + }, + label: { + fontSize: 16, + marginBottom: 5, + fontFamily: '', + }, + input: { + borderWidth: 2.3, + borderRadius: 10, + width: 300, + height: 40, + padding: 10, + fontSize: 16, + }, +}); + +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 99bca3a..8871d1e 100644 --- a/src/screens/Components.tsx +++ b/src/screens/Components.tsx @@ -6,6 +6,7 @@ import { globalStyles } from 'style'; import { PrimaryButton } from '@/components/Button'; import { ConversationTile } from '@/components/ConversationTile'; +import { TextInput } from '@/components/TextInput'; import { SwitchTheme } from '@/components/Theme'; import { RootStackParamList } from '@/types/param'; @@ -16,12 +17,18 @@ const Home = ({ navigation }: Props) => { return ( + Components screen {t('Hello')} navigation.navigate('Home')} /> {}} /> + console.log(text)} + />