import { useState } from 'react' import { View, Text, TextInput, TouchableOpacity, StyleSheet, KeyboardAvoidingView, Platform, ActivityIndicator, Alert, ScrollView, } from 'react-native' import { useAuth } from '../../hooks/useAuth' import { COLORS } from '../../constants/Config' export default function LoginScreen() { const { login } = useAuth() const [username, setUsername] = useState('') const [password, setPassword] = useState('') const [loading, setLoading] = useState(false) const handleLogin = async () => { if (!username.trim() || !password.trim()) { Alert.alert('입력 오류', '아이디와 비밀번호를 입력해주세요.') return } setLoading(true) try { await login(username.trim(), password) } catch (e: any) { const msg = e.response?.data?.detail ?? '로그인에 실패했습니다.' Alert.alert('로그인 실패', msg) } finally { setLoading(false) } } return ( {/* 로고 영역 */} 🛡️ GUARDiA AI 인프라 자율 운영 플랫폼 (주)지오정보기술 {/* 로그인 카드 */} 로그인 아이디 비밀번호 {loading ? : 로그인 } GUARDiA ITSM 계정으로 로그인합니다 v1.0.0 · zioinfo.co.kr ) } const s = StyleSheet.create({ container: { flex: 1, backgroundColor: COLORS.primary }, inner: { flexGrow: 1, justifyContent: 'center', padding: 24 }, logoBox: { alignItems: 'center', marginBottom: 32 }, logoIcon: { fontSize: 56, marginBottom: 8 }, logoTitle: { fontSize: 32, fontWeight: '800', color: '#fff', letterSpacing: 2 }, logoSub: { fontSize: 13, color: '#aac4e8', marginTop: 4 }, badge: { marginTop: 10, backgroundColor: 'rgba(255,255,255,.15)', paddingHorizontal: 14, paddingVertical: 4, borderRadius: 20 }, badgeText: { color: '#fff', fontSize: 11, fontWeight: '600' }, card: { backgroundColor: '#fff', borderRadius: 16, padding: 24, shadowColor: '#000', shadowOffset: { width: 0, height: 8 }, shadowOpacity: 0.15, shadowRadius: 24, elevation: 8 }, cardTitle: { fontSize: 18, fontWeight: '700', color: COLORS.primary, marginBottom: 20, textAlign: 'center' }, field: { marginBottom: 14 }, label: { fontSize: 12, fontWeight: '600', color: COLORS.muted, marginBottom: 6, textTransform: 'uppercase', letterSpacing: .5 }, input: { borderWidth: 1.5, borderColor: COLORS.border, borderRadius: 10, padding: 13, fontSize: 15, color: COLORS.text, backgroundColor: '#fafafa' }, btn: { backgroundColor: COLORS.primary, borderRadius: 10, padding: 15, alignItems: 'center', marginTop: 8 }, btnDisabled: { opacity: .6 }, btnText: { color: '#fff', fontSize: 16, fontWeight: '700' }, hint: { textAlign: 'center', color: COLORS.muted, fontSize: 12, marginTop: 16 }, version: { textAlign: 'center', color: 'rgba(255,255,255,.4)', fontSize: 11, marginTop: 24 }, })