import React from "react"; import { View, Text, TouchableOpacity, Platform } from "react-native"; import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { useTranslation } from "react-i18next"; import * as Haptics from "expo-haptics"; import { House, ScanLine, MapPin } from "lucide-react-native"; import HomeScreen from "@/screens/HomeScreen"; import ScannerScreen from "@/screens/ScannerScreen"; import MapScreen from "@/screens/MapScreen"; import { colors } from "@/theme/colors"; const Tab = createBottomTabNavigator(); const TAB_ICONS: Record = { Home: House, Map: MapPin, }; function MyCustomTabBar({ state, descriptors, navigation }: any) { const insets = useSafeAreaInsets(); return ( {state.routes.map((route: any, index: number) => { const { options } = descriptors[route.key]; const isFocused = state.index === index; const label = options.tabBarLabel || route.name; const isScanner = route.name === "Scanner"; const onPress = () => { if (Platform.OS !== "web") { Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); } const event = navigation.emit({ type: "tabPress", target: route.key, canPreventDefault: true, }); if (!isFocused && !event.defaultPrevented) { navigation.navigate(route.name); } }; // FAB central pour Scanner if (isScanner) { return ( ); } // Onglets classiques (Home, Map) const Icon = TAB_ICONS[route.name]; const tintColor = isFocused ? colors.primary[700] : colors.neutral[400]; return ( {Icon && ( )} {label} ); })} ); } export default function BottomTabNavigator() { const { t } = useTranslation(); return ( } screenOptions={{ headerShown: false }} > ); }