Open History to see the last commit
1import {
2 Text as RNText,
3 TextInput as RNTextInput,
4 type TextInputProps as RNTextInputProps,
5 type TextProps as RNTextProps,
6} from "react-native";
7import { useThemeColor } from "../lib/useThemeColor";
8
9import { cn } from "../lib/cn";
10
11export type AppTextProps = RNTextProps & { readonly className?: string };
12
13/**
14 * Thin wrapper around RN Text with default font-family and foreground color.
15 * Uses Uniwind className — no manual style parsing.
16 */
17export function AppText({ className, ...props }: AppTextProps) {
18 return <RNText className={cn("font-sans text-foreground", className)} {...props} />;
19}
20
21export type AppTextInputProps = RNTextInputProps & {
22 readonly className?: string;
23 readonly ref?: React.Ref<RNTextInput>;
24};
25
26/**
27 * Thin wrapper around RN TextInput with default input styling.
28 * Uses Uniwind className — no manual style parsing.
29 */
30export function AppTextInput({
31 className,
32 placeholderTextColor,
33 ref,
34 ...props
35}: AppTextInputProps) {
36 const placeholderColor = useThemeColor("--color-placeholder");
37
38 return (
39 <RNTextInput
40 ref={ref}
41 className={cn(
42 "min-h-13.5 rounded-2xl border border-input-border bg-input px-3.5 py-3 font-sans text-base text-foreground",
43 className,
44 )}
45 placeholderTextColor={placeholderTextColor ?? placeholderColor}
46 {...props}
47 />
48 );
49}