feat: 로그인 화면 및 공통 속성 생성
This commit is contained in:
27
src/components/ui/AppText.tsx
Normal file
27
src/components/ui/AppText.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import React from "react";
|
||||
import { Text, type TextProps, type TextStyle } from "react-native";
|
||||
import { Theme } from "../../theme/theme";
|
||||
|
||||
type Variant = "logo" | "title" | "body" | "muted" | "error";
|
||||
|
||||
type Props = TextProps & {
|
||||
variant?: Variant;
|
||||
style?: TextStyle | TextStyle[];
|
||||
};
|
||||
|
||||
export default function AppText({ variant = "body", style, ...props }: Props) {
|
||||
const base: TextStyle = {
|
||||
color: Theme.Colors.text,
|
||||
fontSize: Theme.FontSize.md,
|
||||
};
|
||||
|
||||
const variants: Record<Variant, TextStyle> = {
|
||||
logo: { fontSize: Theme.FontSize.xxl, fontWeight: Theme.FontWeight.bold },
|
||||
title: { fontSize: Theme.FontSize.xl, fontWeight: Theme.FontWeight.bold },
|
||||
body: { fontSize: Theme.FontSize.md },
|
||||
muted: { color: Theme.Colors.mutedText, fontSize: Theme.FontSize.sm },
|
||||
error: { color: Theme.Colors.danger, fontSize: Theme.FontSize.sm },
|
||||
};
|
||||
|
||||
return <Text {...props} style={[base, variants[variant], style]} />;
|
||||
}
|
||||
Reference in New Issue
Block a user