kintex/mobile/app/(tabs)/more.tsx
zio 6c9891c7e2 feat: mobile harness + design v2.1 (84 screens) + PLANNING v3.1 + deliverables + Stitch screens
- Harness: kintex-mobile-dev agent + kintex-mobile-orchestrator skill (WISE mobile ref, Stitch-first design rule, dual app targets B2B/B2C)
- design.md v2.1: full 84-screen inventory (web 51 / admin 10 / public 8 / mobile 15) with Stitch prompts incl. ticketing (SCR-P7/P8, M14/M15)
- PLANNING v3.1: unified account + split signup tracks (2FA required for staff, light signup/guest for visitors), one codebase / two app targets
- Deliverables: dev plan (21s), user/operator/developer guides (17/14/15s), program spec (44s, 65 programs, 8 flowcharts), DA (DB design 14s + table spec xlsx 35 tables/299 cols)
- Benchmark: ticketing-app-benchmark.md (7 apps) -> IMPLEMENTATION_BACKLOG Phase F (14 items)
- Stitch: 23 generated screens saved (mobile 10, admin 6, web core 5, ticket 2)
- mobile/: Expo scaffold (SDK 51, expo-router, secure store JWT)
- frontend: SCR-13~17 QA fixes, icons.tsx, kintexEvents, V10 seed migration
- ci/: KINTEX CI logo assets

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 23:31:45 +09:00

98 lines
3.5 KiB
TypeScript

/*
* 더보기 — 계정 정보·API 상태(health)·로그아웃.
*/
import { Ionicons } from '@expo/vector-icons';
import { router } from 'expo-router';
import React, { useCallback, useEffect, useState } from 'react';
import { Pressable, ScrollView, StyleSheet, Text, View } from 'react-native';
import { Card } from '../../components/Card';
import { useAuth } from '../../context/AuthContext';
import { api, isDegraded } from '../../lib/api';
import { API_BASE } from '../../lib/config';
import type { HealthDto } from '../../lib/types';
import { colors, radius, spacing, touch, type } from '../../theme';
export default function MoreScreen() {
const { user, signOut } = useAuth();
const [health, setHealth] = useState<string>('확인 중…');
const checkHealth = useCallback(async () => {
try {
const res = await api.get<HealthDto>('/health', { anonymous: true });
setHealth(res?.status === 'UP' ? '정상 (UP)' : (res?.status ?? '알 수 없음'));
} catch (e) {
setHealth(isDegraded(e) ? '연결 불가 (degraded)' : '오류');
}
}, []);
useEffect(() => {
checkHealth();
}, [checkHealth]);
async function onSignOut() {
await signOut();
router.replace('/login');
}
return (
<ScrollView contentContainerStyle={styles.scroll}>
<Card>
<Text style={styles.name}>{user?.displayName ?? '사용자'}</Text>
<Text style={styles.meta}>
{user?.hallManager ? '킨텍스 내부 계정 (홀매니저)' : '일반 계정'}
</Text>
</Card>
<Card>
<Row label="API 서버" value={API_BASE} />
<View style={styles.divider} />
<Pressable style={styles.healthRow} onPress={checkHealth}>
<Row label="서버 상태" value={health} />
<Ionicons name="refresh" size={18} color={colors.primary600} />
</Pressable>
</Card>
<Pressable style={styles.signOut} onPress={onSignOut}>
<Ionicons name="log-out-outline" size={20} color={colors.error} />
<Text style={styles.signOutText}></Text>
</Pressable>
<Text style={styles.version}>KINTEX AI · v0.1.0</Text>
</ScrollView>
);
}
function Row({ label, value }: { label: string; value: string }) {
return (
<View style={styles.row}>
<Text style={styles.rowLabel}>{label}</Text>
<Text style={styles.rowValue} numberOfLines={1}>
{value}
</Text>
</View>
);
}
const styles = StyleSheet.create({
scroll: { padding: spacing.md, gap: spacing.md },
name: { fontSize: type.h3.fontSize, fontWeight: '700', color: colors.neutral900 },
meta: { marginTop: 4, color: colors.neutral500, fontSize: type.caption.fontSize },
row: { flexDirection: 'row', justifyContent: 'space-between', gap: 12, paddingVertical: 4 },
rowLabel: { color: colors.neutral500, fontSize: type.body.fontSize },
rowValue: { flex: 1, textAlign: 'right', color: colors.neutral900, fontSize: type.body.fontSize },
divider: { height: 1, backgroundColor: colors.neutral200, marginVertical: 6 },
healthRow: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between' },
signOut: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
gap: 8,
minHeight: touch.min,
borderRadius: radius.sm,
borderWidth: 1,
borderColor: colors.error,
},
signOutText: { color: colors.error, fontSize: type.h3.fontSize, fontWeight: '600' },
version: { textAlign: 'center', color: colors.neutral500, fontSize: type.caption.fontSize },
});