Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

AppText.tsx

41 lines1.2 KB

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