56 lines
1.6 KiB
TypeScript
Raw Normal View History

2025-01-28 08:19:46 -06:00
import { Tabs } from 'expo-router';
import React from 'react';
import { Platform } from 'react-native';
import { HapticTab } from '@/components/default/HapticTab';
2025-01-28 08:19:46 -06:00
import { IconSymbol } from '@/components/ui/IconSymbol';
import TabBarBackground from '@/components/ui/TabBarBackground';
import { Colors } from '@/constants/Colors';
import { useColorScheme } from '@/hooks/useColorScheme';
const TabLayout = () => {
const scheme = useColorScheme() ?? 'dark';
2025-01-28 08:19:46 -06:00
return (
<Tabs
screenOptions={{
tabBarActiveTintColor: Colors[scheme].tint,
2025-01-28 08:19:46 -06:00
headerShown: false,
headerStyle: {
backgroundColor: Colors[scheme].background,
},
2025-01-28 08:19:46 -06:00
tabBarButton: HapticTab,
tabBarBackground: TabBarBackground,
tabBarStyle: Platform.select({
ios: {
// Use a transparent background on iOS to show the blur effect
position: 'absolute',
},
default: {
backgroundColor: Colors[scheme].background,
borderTopColor: Colors[scheme].tint,
borderTopWidth: 1,
},
2025-01-28 08:19:46 -06:00
}),
2025-01-28 08:45:02 -06:00
}}
>
2025-01-28 08:19:46 -06:00
<Tabs.Screen
2025-01-28 08:45:02 -06:00
name='index'
2025-01-28 08:19:46 -06:00
options={{
title: 'Home',
2025-01-28 13:24:20 -06:00
tabBarIcon: ({ color }) =>
<IconSymbol size={28} name='house.fill' color={color} />,
2025-01-28 08:19:46 -06:00
}}
/>
<Tabs.Screen
name='settings'
2025-01-28 08:19:46 -06:00
options={{
title: 'Settings',
2025-01-28 13:24:20 -06:00
tabBarIcon: ({ color }) =>
<IconSymbol size={28} name='gearshape.fill' color={color} />,
2025-01-28 08:19:46 -06:00
}}
/>
</Tabs>
);
};
export default TabLayout;