diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx index f4b6bf0..da6a42c 100644 --- a/app/(tabs)/_layout.tsx +++ b/app/(tabs)/_layout.tsx @@ -1,17 +1,32 @@ import { Tabs } from 'expo-router'; -import React from 'react'; -import { Platform } from 'react-native'; +import React, { useCallback } from 'react'; +import { Platform, View, Alert } from 'react-native'; import { Feather } from '@expo/vector-icons'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { HapticTab } from '@/components/haptic-tab'; +import { VoiceFAB } from '@/components/VoiceFAB'; import { AppColors } from '@/constants/theme'; import { useColorScheme } from '@/hooks/use-color-scheme'; +import { useVoiceCall } from '@/contexts/VoiceCallContext'; export default function TabLayout() { const colorScheme = useColorScheme(); const isDark = colorScheme === 'dark'; const insets = useSafeAreaInsets(); + // VoiceFAB uses VoiceCallContext internally to hide when call is active + useVoiceCall(); // Ensure context is available + + // Handle voice FAB press - initiate voice call + const handleVoiceFABPress = useCallback(() => { + // TODO: Integrate with LiveKit voice call when ready + // For now, show placeholder alert + Alert.alert( + 'Voice Call', + 'Voice call with Julia AI will be available soon.', + [{ text: 'OK' }] + ); + }, []); // Calculate tab bar height based on safe area // On iOS with home indicator, insets.bottom is ~34px @@ -24,81 +39,86 @@ export default function TabLayout() { const tabBarHeight = 60 + bottomPadding; // 60px for content + safe area padding return ( - - ( - - ), + + - {/* Hide old dashboard - now index shows WebView dashboard */} - - {/* Chat with Julia AI */} - ( - - ), - }} - /> - ( - - ), - }} - /> - {/* Hide explore tab */} - - {/* Audio Debug - hidden */} - - {/* Beneficiaries - hidden from tab bar but keeps tab bar visible */} - - + > + ( + + ), + }} + /> + {/* Hide old dashboard - now index shows WebView dashboard */} + + {/* Chat with Julia AI */} + ( + + ), + }} + /> + ( + + ), + }} + /> + {/* Hide explore tab */} + + {/* Audio Debug - hidden */} + + {/* Beneficiaries - hidden from tab bar but keeps tab bar visible */} + + + + {/* Voice FAB - shown when no call is active */} + + ); }