- V3 모바일 마스터 플랜 작성 (docs/v3/00-mobile-master-plan.md) 11개 Phase, 5주 로드맵, 전략 결정사항 확정 - 7개 디자인 HTML 레퍼런스 저장 (docs/v3/designs/) - app.json → app.config.ts 전환 + 환경변수 체계 - 5탭 네비게이션 (DASH/HIST/REC FAB/TALK/SET) - metro.config.js monorepo 격리 (root RN 0.84 충돌 해결) - ui-native 테마 디자인 목업 색상 동기화 - SafeArea 적용 (useSafeAreaInsets) - DEV 로그인 우회 (__DEV__ 전용) - Supabase .env 연동 - iOS 시뮬레이터 검증 완료
28 lines
771 B
TypeScript
28 lines
771 B
TypeScript
// apps/mobile/app/index.tsx
|
|
// 진입점 — 로그인 상태에 따라 리다이렉트
|
|
|
|
import { useEffect } from 'react'
|
|
import { ActivityIndicator, View } from 'react-native'
|
|
import { useRouter } from 'expo-router'
|
|
import { useAuth } from '../lib/auth-context'
|
|
|
|
export default function Index(): React.ReactElement {
|
|
const router = useRouter()
|
|
const { user, loading } = useAuth()
|
|
|
|
useEffect(() => {
|
|
if (!loading) {
|
|
if (user) {
|
|
router.replace('/(tabs)/dash')
|
|
} else {
|
|
router.replace('/login')
|
|
}
|
|
}
|
|
}, [user, loading, router])
|
|
|
|
return (
|
|
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#19191b' }}>
|
|
<ActivityIndicator size="large" color="#f25b29" />
|
|
</View>
|
|
)
|
|
}
|