refactor: use CustomTextInput in login and register screens
- Replace raw TextInput with CustomTextInput in login and register for consistent focus border effect across the app - Add placeholder, secureTextEntry, autoCapitalize, keyboardType props to CustomTextInput - Remove hardcoded default padding (px-3 py-2) and h-11/12 from CustomTextInput, callers now set padding via className - Add explicit px-3 py-2 to existing callers (settings, editEvent) - Update CLAUDE.md with new CustomTextInput usage and props
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { TextInput } from "react-native";
|
||||
import { TextInput, TextInputProps } from "react-native";
|
||||
import { useThemeStore } from "../stores/ThemeStore";
|
||||
import { useState } from "react";
|
||||
|
||||
@@ -8,6 +8,11 @@ export type CustomTextInputProps = {
|
||||
className?: string;
|
||||
multiline?: boolean;
|
||||
onValueChange?: (text: string) => void;
|
||||
placeholder?: string;
|
||||
placeholderTextColor?: string;
|
||||
secureTextEntry?: boolean;
|
||||
autoCapitalize?: TextInputProps["autoCapitalize"];
|
||||
keyboardType?: TextInputProps["keyboardType"];
|
||||
};
|
||||
|
||||
const CustomTextInput = (props: CustomTextInputProps) => {
|
||||
@@ -16,10 +21,15 @@ const CustomTextInput = (props: CustomTextInputProps) => {
|
||||
|
||||
return (
|
||||
<TextInput
|
||||
className={`border border-solid rounded-2xl px-3 py-2 h-11/12 ${props.className}`}
|
||||
className={`border border-solid rounded-2xl ${props.className}`}
|
||||
onChangeText={props.onValueChange}
|
||||
value={props.text}
|
||||
multiline={props.multiline}
|
||||
placeholder={props.placeholder}
|
||||
placeholderTextColor={props.placeholderTextColor}
|
||||
secureTextEntry={props.secureTextEntry}
|
||||
autoCapitalize={props.autoCapitalize}
|
||||
keyboardType={props.keyboardType}
|
||||
style={{
|
||||
backgroundColor: theme.messageBorderBg,
|
||||
color: theme.textPrimary,
|
||||
|
||||
Reference in New Issue
Block a user