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
55 lines
1.6 KiB
TypeScript
55 lines
1.6 KiB
TypeScript
import { type ReactNode } from "react";
|
|
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
|
|
import { Text } from "react-native";
|
|
import LibraryScreen from "../screens/LibraryScreen";
|
|
import SearchScreen from "../screens/SearchScreen";
|
|
import SettingsScreen from "../screens/SettingsScreen";
|
|
|
|
export type MainTabParamList = {
|
|
Library: undefined;
|
|
Search: undefined;
|
|
Settings: undefined;
|
|
};
|
|
|
|
const Tab = createBottomTabNavigator<MainTabParamList>();
|
|
|
|
function TabIcon({ label, focused }: { label: string; focused: boolean }) {
|
|
return (
|
|
<Text style={{ fontSize: 22, opacity: focused ? 1 : 0.5 }}>
|
|
{label === "Library" ? "📚" : label === "Search" ? "🔍" : "⚙️"}
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
export default function MainTabs(): ReactNode {
|
|
return (
|
|
<Tab.Navigator
|
|
screenOptions={({ route }) => ({
|
|
tabBarIcon: ({ focused }: { focused: boolean }) => (
|
|
<TabIcon label={route.name} focused={focused} />
|
|
),
|
|
tabBarActiveTintColor: "#4f8ef7",
|
|
tabBarInactiveTintColor: "#888",
|
|
headerStyle: { backgroundColor: "#1a1a2e" },
|
|
headerTintColor: "#fff",
|
|
tabBarStyle: { backgroundColor: "#1a1a2e", borderTopColor: "#333" },
|
|
})}
|
|
>
|
|
<Tab.Screen
|
|
name="Library"
|
|
component={LibraryScreen}
|
|
options={{ title: "My Library" }}
|
|
/>
|
|
<Tab.Screen
|
|
name="Search"
|
|
component={SearchScreen}
|
|
options={{ title: "Search" }}
|
|
/>
|
|
<Tab.Screen
|
|
name="Settings"
|
|
component={SettingsScreen}
|
|
options={{ title: "Settings" }}
|
|
/>
|
|
</Tab.Navigator>
|
|
);
|
|
} |