Ship Expo Router screens, seeded stores, and polished UX so auth, shop, checkout, prescriptions, loyalty, family, and account processes work end-to-end offline. Co-authored-by: Cursor <cursoragent@cursor.com>
28 lines
657 B
TypeScript
28 lines
657 B
TypeScript
import { Text as RNText, type TextProps as RNTextProps } from "react-native";
|
|
import { colors, typography, type TypeVariant } from "@/lib/theme";
|
|
|
|
export type TextProps = RNTextProps & {
|
|
variant?: TypeVariant;
|
|
color?: string;
|
|
center?: boolean;
|
|
};
|
|
|
|
/**
|
|
* App-wide text primitive. React Native does not inherit `fontFamily`, so every
|
|
* piece of copy goes through here to stay on the type scale.
|
|
*/
|
|
export function Text({
|
|
variant = "body",
|
|
color = colors.ink,
|
|
center,
|
|
style,
|
|
...rest
|
|
}: TextProps) {
|
|
return (
|
|
<RNText
|
|
style={[typography[variant], { color }, center && { textAlign: "center" }, style]}
|
|
{...rest}
|
|
/>
|
|
);
|
|
}
|