feat: 로그인 화면 및 공통 속성 생성

This commit is contained in:
2025-12-31 18:40:46 +09:00
parent 822cd55c93
commit 7400363466
17 changed files with 689 additions and 17 deletions

View File

@@ -0,0 +1,73 @@
import React from "react";
import { Pressable, type PressableProps, StyleSheet, View } from "react-native";
import { Theme } from "../../theme/theme";
import AppText from "./AppText";
type Props = PressableProps & {
title: string;
variant?: "primary" | "secondary";
};
export default function Button({
title,
variant = "primary",
style,
...props
}: Props) {
const isPrimary = variant === "primary";
return (
<Pressable
{...props}
style={({ pressed }) => [
styles.base,
isPrimary ? styles.primary : styles.secondary,
pressed &&
(isPrimary ? styles.primaryPressed : styles.secondaryPressed),
typeof style === "function" ? style({ pressed }) : style,
]}
>
<View>
<AppText
style={{
textAlign: "center",
fontWeight: Theme.FontWeight.bold,
color: isPrimary ? Theme.Colors.text : Theme.Colors.text,
}}
>
{title}
</AppText>
</View>
</Pressable>
);
}
const styles = StyleSheet.create({
base: {
height: 48,
paddingVertical: 0,
paddingHorizontal: Theme.Spacing.lg,
borderRadius: Theme.Radius.md,
alignItems: "center", // 가로 가운데
justifyContent: "center", // 세로 가운데
},
text: {
textAlign: "center",
fontWeight: Theme.FontWeight.bold,
lineHeight: 20,
},
primary: {
backgroundColor: Theme.Colors.primary,
},
primaryPressed: {
backgroundColor: Theme.Colors.primaryPressed,
},
secondary: {
backgroundColor: Theme.Colors.surface,
borderWidth: 1,
borderColor: Theme.Colors.border,
},
secondaryPressed: {
opacity: 0.9,
},
});