import * as Haptics from 'expo-haptics'; import { Tabs, usePathname } from 'expo-router'; import React from 'react'; import { Text, TouchableOpacity, View } from 'react-native'; import { IconSymbol } from '@/components/ui/IconSymbol'; export default function TabLayout() { const pathname = usePathname(); return ( { const routeName = route.name; const isSelected = (routeName === 'index' && pathname === '/') || (routeName === 'explore' && pathname === '/explore') || pathname.includes(routeName); return { tabBarActiveTintColor: '#192126', tabBarButton: (props) => { const { children, onPress } = props; const handlePress = (event: any) => { if (process.env.EXPO_OS === 'ios') { Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light); } onPress && onPress(event); }; return ( {children} ); }, tabBarStyle: { position: 'absolute', bottom: 20, height: 68, borderRadius: 34, backgroundColor: '#192126', shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.2, shadowRadius: 10, elevation: 5, paddingHorizontal: 10, paddingTop: 0, paddingBottom: 0, marginHorizontal: 20, width: '90%', alignSelf: 'center', }, tabBarItemStyle: { backgroundColor: 'transparent', height: 68, marginTop: 0, marginBottom: 0, paddingTop: 0, paddingBottom: 0, }, tabBarShowLabel: false, }; }}> { const isHomeSelected = pathname === '/' || pathname === '/index'; return ( {isHomeSelected && ( Home )} ); }, }} /> { const isExploreSelected = pathname === '/explore'; return ( {isExploreSelected && ( Explore )} ); }, }} /> ); }