Archived
- Add mobile/ directory with Expo React Native project - Create API client with JWT auth and token refresh using AsyncStorage - Implement AuthContext for login/register/logout flow - Add screens: Login, Register, Library, Search, Settings - Set up React Navigation with AuthStack and MainTabs - Create packages/shared/ with shared types and utilities - Add shared validation utilities (email, password strength) - Update root package.json workspaces to include mobile + shared - Add spec document docs/backend/009-expo-integration.md
23 lines
607 B
TypeScript
23 lines
607 B
TypeScript
import React from "react";
|
|
import { ActivityIndicator, View } from "react-native";
|
|
import { useAuth } from "../context/AuthContext";
|
|
import { AuthNavigator } from "./AuthNavigator";
|
|
import { MainNavigator } from "./MainNavigator";
|
|
|
|
export function RootNavigator() {
|
|
const { isLoading, isAuthenticated } = useAuth();
|
|
|
|
if (isLoading) {
|
|
return (
|
|
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
|
|
<ActivityIndicator size="large" color="#4a6cf7" />
|
|
</View>
|
|
);
|
|
}
|
|
|
|
if (!isAuthenticated) {
|
|
return <AuthNavigator />;
|
|
}
|
|
|
|
return <MainNavigator />;
|
|
} |