mojmajstor/components/ui/input.tsx
echo 3e5b85a08e feat: Phase 7 - polish, error handling, pagination, accessibility
- Error boundary with Macedonian fallback screen and retry button
  wrapping all navigation
- Pull-to-refresh on all list/detail screens (home, explore, posts,
  chat, profile, ad detail, post detail)
- Accessibility: labels on all interactive elements, roles on
  Pressable/Button, selectable text for user data
- Deep linking: mojmajstor:// scheme configured in app.json,
  ad/[id] and chat/[id] routes work via Expo Router auto-routing
- Pagination: cursor-based paginated queries for ads, posts,
  messages, chats, reviews with Load More buttons on frontend
- Profile: shows customer posts with PostCard, loading/error states,
  create-post navigation
- Auth error messages in Macedonian (Невалидни акредитиви, итн.)

All UI text in Macedonian. TypeScript clean, Convex functions deployed.
2026-05-29 18:53:26 +02:00

34 lines
993 B
TypeScript

import { TextInput, type TextInputProps, type ViewStyle } from "react-native";
import { useTheme } from "../theme";
interface InputProps extends TextInputProps {
error?: string;
}
export function Input({ error, style, ...props }: InputProps) {
const theme = useTheme();
return (
<TextInput
accessible
accessibilityLabel={props.placeholder || "Внесете текст"}
accessibilityRole="none"
placeholderTextColor={theme.colors.textTertiary}
style={[
{
backgroundColor: theme.colors.surface,
borderColor: error ? theme.colors.error : theme.colors.border,
borderWidth: 1,
borderRadius: theme.radius.md,
paddingVertical: 12,
paddingHorizontal: theme.spacing.md,
fontSize: 16,
color: theme.colors.text,
},
error && { borderColor: theme.colors.error },
typeof style === "object" ? style : undefined,
]}
{...props}
/>
);
}