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:
@@ -98,7 +98,7 @@ src/
|
|||||||
│ ├── EventConfirmDialog.tsx # AI-proposed event confirmation modal (skeleton)
|
│ ├── EventConfirmDialog.tsx # AI-proposed event confirmation modal (skeleton)
|
||||||
│ ├── ProposedEventCard.tsx # Chat event proposal (uses EventCardBase + confirm/reject/edit buttons)
|
│ ├── ProposedEventCard.tsx # Chat event proposal (uses EventCardBase + confirm/reject/edit buttons)
|
||||||
│ ├── DeleteEventModal.tsx # Delete confirmation modal (uses ModalBase)
|
│ ├── DeleteEventModal.tsx # Delete confirmation modal (uses ModalBase)
|
||||||
│ ├── CustomTextInput.tsx # Themed text input with focus border (used in CaldavSettings)
|
│ ├── CustomTextInput.tsx # Themed text input with focus border (used in login, register, CaldavSettings, editEvent)
|
||||||
│ ├── DateTimePicker.tsx # Date and time picker components
|
│ ├── DateTimePicker.tsx # Date and time picker components
|
||||||
│ └── ScrollableDropdown.tsx # Scrollable dropdown component
|
│ └── ScrollableDropdown.tsx # Scrollable dropdown component
|
||||||
├── Themes.tsx # Theme definitions: THEMES object with defaultLight/defaultDark, Theme type
|
├── Themes.tsx # Theme definitions: THEMES object with defaultLight/defaultDark, Theme type
|
||||||
@@ -602,8 +602,8 @@ NODE_ENV=development # development = pretty logs, production = JSON
|
|||||||
- `AuthService`: login(), register(), logout() - calls backend API
|
- `AuthService`: login(), register(), logout() - calls backend API
|
||||||
- `ApiClient`: Automatically injects X-User-Id header for authenticated requests, handles empty responses (204)
|
- `ApiClient`: Automatically injects X-User-Id header for authenticated requests, handles empty responses (204)
|
||||||
- `AuthGuard`: Reusable component that wraps protected routes - loads user, preloads app data (events + CalDAV config) into stores before dismissing spinner, triggers CalDAV sync, shows loading, redirects if unauthenticated. Exports `preloadAppData()` (also called by `login.tsx`)
|
- `AuthGuard`: Reusable component that wraps protected routes - loads user, preloads app data (events + CalDAV config) into stores before dismissing spinner, triggers CalDAV sync, shows loading, redirects if unauthenticated. Exports `preloadAppData()` (also called by `login.tsx`)
|
||||||
- Login screen: Supports email OR userName login, preloads app data + triggers CalDAV sync after successful login
|
- Login screen: Supports email OR userName login, uses CustomTextInput with focus border, preloads app data + triggers CalDAV sync after successful login
|
||||||
- Register screen: Email validation, checks for existing email/userName
|
- Register screen: Email validation, checks for existing email/userName, uses CustomTextInput with focus border
|
||||||
- `AuthButton`: Reusable button component with themed shadow
|
- `AuthButton`: Reusable button component with themed shadow
|
||||||
- `Header`: Themed header component (logout moved to Settings)
|
- `Header`: Themed header component (logout moved to Settings)
|
||||||
- `(tabs)/_layout.tsx`: Wraps tabs with AuthGuard for protected access
|
- `(tabs)/_layout.tsx`: Wraps tabs with AuthGuard for protected access
|
||||||
@@ -639,7 +639,7 @@ NODE_ENV=development # development = pretty logs, production = JSON
|
|||||||
- `EventService`: getAll(), getById(), getByDateRange(), create(), update(), delete(mode, occurrenceDate) - fully implemented with recurring delete modes
|
- `EventService`: getAll(), getById(), getByDateRange(), create(), update(), delete(mode, occurrenceDate) - fully implemented with recurring delete modes
|
||||||
- `ChatService`: sendMessage(), confirmEvent(deleteMode, occurrenceDate), rejectEvent(), getConversations(), getConversation(), updateProposalEvent() - fully implemented with cursor pagination, recurring delete support, and proposal editing
|
- `ChatService`: sendMessage(), confirmEvent(deleteMode, occurrenceDate), rejectEvent(), getConversations(), getConversation(), updateProposalEvent() - fully implemented with cursor pagination, recurring delete support, and proposal editing
|
||||||
- `CaldavConfigService`: saveConfig(), getConfig(), deleteConfig(), pull(), pushAll(), sync() - CalDAV config management and sync trigger
|
- `CaldavConfigService`: saveConfig(), getConfig(), deleteConfig(), pull(), pushAll(), sync() - CalDAV config management and sync trigger
|
||||||
- `CustomTextInput`: Themed text input component with focus border highlight, supports controlled value via `text` prop
|
- `CustomTextInput`: Themed text input with focus border highlight. Props: `text`, `onValueChange`, `placeholder`, `placeholderTextColor`, `secureTextEntry`, `autoCapitalize`, `keyboardType`, `className`, `multiline`. No default padding — callers must set padding via `className` (e.g., `px-3 py-2` or `p-4`)
|
||||||
- `CardBase`: Reusable card component with header (title/subtitle), content area, and optional footer button - configurable padding, border, text size via props, ScrollView uses `nestedScrollEnabled` for Android
|
- `CardBase`: Reusable card component with header (title/subtitle), content area, and optional footer button - configurable padding, border, text size via props, ScrollView uses `nestedScrollEnabled` for Android
|
||||||
- `ModalBase`: Reusable modal wrapper with backdrop (absolute-positioned behind card), uses CardBase internally - provides click-outside-to-close, Android back button support, and proper scrolling on Android
|
- `ModalBase`: Reusable modal wrapper with backdrop (absolute-positioned behind card), uses CardBase internally - provides click-outside-to-close, Android back button support, and proper scrolling on Android
|
||||||
- `EventCardBase`: Event card with date/time/recurring icons - uses CardBase for structure. Accepts `recurrenceRule` string (not boolean) and displays German-formatted recurrence via `formatRecurrenceRule()`
|
- `EventCardBase`: Event card with date/time/recurring icons - uses CardBase for structure. Accepts `recurrenceRule` string (not boolean) and displays German-formatted recurrence via `formatRecurrenceRule()`
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const CaldavTextInput = ({
|
|||||||
<View className="flex flex-row items-center py-1">
|
<View className="flex flex-row items-center py-1">
|
||||||
<Text className="ml-4 w-24">{title}:</Text>
|
<Text className="ml-4 w-24">{title}:</Text>
|
||||||
<CustomTextInput
|
<CustomTextInput
|
||||||
className="flex-1 mr-4"
|
className="flex-1 mr-4 px-3 py-2"
|
||||||
text={value}
|
text={value}
|
||||||
onValueChange={onValueChange}
|
onValueChange={onValueChange}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ const EditEventTextField = (props: EditEventTextFieldProps) => {
|
|||||||
{props.titel}
|
{props.titel}
|
||||||
</Text>
|
</Text>
|
||||||
<CustomTextInput
|
<CustomTextInput
|
||||||
className="flex-1"
|
className="flex-1 px-3 py-2"
|
||||||
text={props.text}
|
text={props.text}
|
||||||
multiline={props.multiline}
|
multiline={props.multiline}
|
||||||
onValueChange={props.onValueChange}
|
onValueChange={props.onValueChange}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { View, Text, TextInput, Pressable } from "react-native";
|
import { View, Text, Pressable } from "react-native";
|
||||||
import { Link, router } from "expo-router";
|
import { Link, router } from "expo-router";
|
||||||
import BaseBackground from "../components/BaseBackground";
|
import BaseBackground from "../components/BaseBackground";
|
||||||
import AuthButton from "../components/AuthButton";
|
import AuthButton from "../components/AuthButton";
|
||||||
|
import CustomTextInput from "../components/CustomTextInput";
|
||||||
import { AuthService } from "../services";
|
import { AuthService } from "../services";
|
||||||
import { CaldavConfigService } from "../services/CaldavConfigService";
|
import { CaldavConfigService } from "../services/CaldavConfigService";
|
||||||
import { preloadAppData } from "../components/AuthGuard";
|
import { preloadAppData } from "../components/AuthGuard";
|
||||||
@@ -59,34 +60,22 @@ const LoginScreen = () => {
|
|||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<TextInput
|
<CustomTextInput
|
||||||
placeholder="E-Mail oder Benutzername"
|
placeholder="E-Mail oder Benutzername"
|
||||||
placeholderTextColor={theme.textMuted}
|
placeholderTextColor={theme.textMuted}
|
||||||
value={identifier}
|
text={identifier}
|
||||||
onChangeText={setIdentifier}
|
onValueChange={setIdentifier}
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
className="w-full rounded-lg p-4 mb-4"
|
className="w-full rounded-lg p-4 mb-4"
|
||||||
style={{
|
|
||||||
backgroundColor: theme.secondaryBg,
|
|
||||||
color: theme.textPrimary,
|
|
||||||
borderWidth: 1,
|
|
||||||
borderColor: theme.borderPrimary,
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextInput
|
<CustomTextInput
|
||||||
placeholder="Passwort"
|
placeholder="Passwort"
|
||||||
placeholderTextColor={theme.textMuted}
|
placeholderTextColor={theme.textMuted}
|
||||||
value={password}
|
text={password}
|
||||||
onChangeText={setPassword}
|
onValueChange={setPassword}
|
||||||
secureTextEntry
|
secureTextEntry
|
||||||
className="w-full rounded-lg p-4 mb-6"
|
className="w-full rounded-lg p-4 mb-6"
|
||||||
style={{
|
|
||||||
backgroundColor: theme.secondaryBg,
|
|
||||||
color: theme.textPrimary,
|
|
||||||
borderWidth: 1,
|
|
||||||
borderColor: theme.borderPrimary,
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<AuthButton
|
<AuthButton
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { View, Text, TextInput, Pressable } from "react-native";
|
import { View, Text, Pressable } from "react-native";
|
||||||
import { Link, router } from "expo-router";
|
import { Link, router } from "expo-router";
|
||||||
import BaseBackground from "../components/BaseBackground";
|
import BaseBackground from "../components/BaseBackground";
|
||||||
import AuthButton from "../components/AuthButton";
|
import AuthButton from "../components/AuthButton";
|
||||||
|
import CustomTextInput from "../components/CustomTextInput";
|
||||||
import { AuthService } from "../services";
|
import { AuthService } from "../services";
|
||||||
import { useThemeStore } from "../stores/ThemeStore";
|
import { useThemeStore } from "../stores/ThemeStore";
|
||||||
|
|
||||||
@@ -59,50 +60,32 @@ const RegisterScreen = () => {
|
|||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<TextInput
|
<CustomTextInput
|
||||||
placeholder="E-Mail"
|
placeholder="E-Mail"
|
||||||
placeholderTextColor={theme.textMuted}
|
placeholderTextColor={theme.textMuted}
|
||||||
value={email}
|
text={email}
|
||||||
onChangeText={setEmail}
|
onValueChange={setEmail}
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
keyboardType="email-address"
|
keyboardType="email-address"
|
||||||
className="w-full rounded-lg p-4 mb-4"
|
className="w-full rounded-lg p-4 mb-4"
|
||||||
style={{
|
|
||||||
backgroundColor: theme.secondaryBg,
|
|
||||||
color: theme.textPrimary,
|
|
||||||
borderWidth: 1,
|
|
||||||
borderColor: theme.borderPrimary,
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextInput
|
<CustomTextInput
|
||||||
placeholder="Benutzername"
|
placeholder="Benutzername"
|
||||||
placeholderTextColor={theme.textMuted}
|
placeholderTextColor={theme.textMuted}
|
||||||
value={userName}
|
text={userName}
|
||||||
onChangeText={setUserName}
|
onValueChange={setUserName}
|
||||||
autoCapitalize="none"
|
autoCapitalize="none"
|
||||||
className="w-full rounded-lg p-4 mb-4"
|
className="w-full rounded-lg p-4 mb-4"
|
||||||
style={{
|
|
||||||
backgroundColor: theme.secondaryBg,
|
|
||||||
color: theme.textPrimary,
|
|
||||||
borderWidth: 1,
|
|
||||||
borderColor: theme.borderPrimary,
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextInput
|
<CustomTextInput
|
||||||
placeholder="Passwort"
|
placeholder="Passwort"
|
||||||
placeholderTextColor={theme.textMuted}
|
placeholderTextColor={theme.textMuted}
|
||||||
value={password}
|
text={password}
|
||||||
onChangeText={setPassword}
|
onValueChange={setPassword}
|
||||||
secureTextEntry
|
secureTextEntry
|
||||||
className="w-full rounded-lg p-4 mb-6"
|
className="w-full rounded-lg p-4 mb-6"
|
||||||
style={{
|
|
||||||
backgroundColor: theme.secondaryBg,
|
|
||||||
color: theme.textPrimary,
|
|
||||||
borderWidth: 1,
|
|
||||||
borderColor: theme.borderPrimary,
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<AuthButton
|
<AuthButton
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { TextInput } from "react-native";
|
import { TextInput, TextInputProps } from "react-native";
|
||||||
import { useThemeStore } from "../stores/ThemeStore";
|
import { useThemeStore } from "../stores/ThemeStore";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
@@ -8,6 +8,11 @@ export type CustomTextInputProps = {
|
|||||||
className?: string;
|
className?: string;
|
||||||
multiline?: boolean;
|
multiline?: boolean;
|
||||||
onValueChange?: (text: string) => void;
|
onValueChange?: (text: string) => void;
|
||||||
|
placeholder?: string;
|
||||||
|
placeholderTextColor?: string;
|
||||||
|
secureTextEntry?: boolean;
|
||||||
|
autoCapitalize?: TextInputProps["autoCapitalize"];
|
||||||
|
keyboardType?: TextInputProps["keyboardType"];
|
||||||
};
|
};
|
||||||
|
|
||||||
const CustomTextInput = (props: CustomTextInputProps) => {
|
const CustomTextInput = (props: CustomTextInputProps) => {
|
||||||
@@ -16,10 +21,15 @@ const CustomTextInput = (props: CustomTextInputProps) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<TextInput
|
<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}
|
onChangeText={props.onValueChange}
|
||||||
value={props.text}
|
value={props.text}
|
||||||
multiline={props.multiline}
|
multiline={props.multiline}
|
||||||
|
placeholder={props.placeholder}
|
||||||
|
placeholderTextColor={props.placeholderTextColor}
|
||||||
|
secureTextEntry={props.secureTextEntry}
|
||||||
|
autoCapitalize={props.autoCapitalize}
|
||||||
|
keyboardType={props.keyboardType}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: theme.messageBorderBg,
|
backgroundColor: theme.messageBorderBg,
|
||||||
color: theme.textPrimary,
|
color: theme.textPrimary,
|
||||||
|
|||||||
Reference in New Issue
Block a user