import 'react-native-gesture-handler'
import { NavigationContainer } from '@react-navigation/native'
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import { createStackNavigator } from '@react-navigation/stack'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import { StatusBar } from 'expo-status-bar'
import { Text, View } from 'react-native'
import { AuthProvider, useAuth } from './src/context/AuthContext.jsx'
import HomeScreen from './src/screens/HomeScreen.jsx'
import InventoryScreen from './src/screens/InventoryScreen.jsx'
import SearchScreen from './src/screens/SearchScreen.jsx'
import BarcodeScreen from './src/screens/BarcodeScreen.jsx'
import ProfileScreen from './src/screens/ProfileScreen.jsx'
import ShoppingListsScreen from './src/screens/ShoppingListsScreen.jsx'
import MealPlannersScreen from './src/screens/MealPlannersScreen.jsx'
import AdminScreen from './src/screens/AdminScreen.jsx'
import UsersScreen from './src/screens/UsersScreen.jsx'
import { colors } from './src/theme.js'
const Tab = createBottomTabNavigator()
const Stack = createStackNavigator()
function TabIcon({ name, focused }) {
const icons = {
Home: '🏠', Inventory: '📦', Search: '🔍', Barcode: '📷',
Shopping: '🛒', Meals: '🍽️', Profile: '👤', Admin: '⚙️', Users: '👥',
}
return (
{icons[name] || '•'}
)
}
function MainTabs() {
const { isSiteAdmin } = useAuth()
return (
({
tabBarIcon: ({ focused }) => ,
tabBarActiveTintColor: colors.primary,
tabBarInactiveTintColor: colors.textMuted,
tabBarStyle: { backgroundColor: colors.surface, borderTopColor: colors.border },
headerStyle: { backgroundColor: colors.surface },
headerTintColor: colors.text,
headerTitleStyle: { fontWeight: '700' },
tabBarLabelStyle: { fontSize: 10 },
})}
>
{isSiteAdmin && }
{isSiteAdmin && }
)
}
export default function App() {
return (
)
}