import { useEffect, useState } from 'react'; import { Tabs, useSegments } from 'expo-router'; import { Dimensions, Platform } from 'react-native'; import { TabAccountIcon, TabChargingIcon, TabHomeIcon } from '../../../component/global/SVG'; import { useColorScheme } from 'nativewind'; export default function TabLayout() { const { height } = Dimensions.get('window'); const { colorScheme } = useColorScheme(); const activeColor = colorScheme === 'dark' ? '#36DFFF' : '#02677D'; const inactiveColor = colorScheme === 'dark' ? '#666666' : '#BBBBBB'; const segment = useSegments(); const [tabBarVisible, setTabBarVisible] = useState(true); // Calculate marginBottom based on screen height const calculateMarginBottom = () => { if (Platform.OS === 'ios') return 0; if (height < 600) return 0; return 15; }; useEffect(() => { // Determine if the tab bar should be visible based on the current segment const isScanQrPage = segment[segment.length - 1] === 'scanQrPage'; setTabBarVisible(!isScanQrPage); }, [segment]); return ( }} /> }} /> }} /> ); }