You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_layout.tsx 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import { Tabs } from 'expo-router';
  2. import React from 'react';
  3. import { Platform } from 'react-native';
  4. import { HapticTab } from '@/components/HapticTab';
  5. import { IconSymbol } from '@/components/ui/IconSymbol';
  6. import TabBarBackground from '@/components/ui/TabBarBackground';
  7. import { Colors } from '@/constants/Colors';
  8. import { useColorScheme } from '@/hooks/useColorScheme';
  9. export default function TabLayout() {
  10. const colorScheme = useColorScheme();
  11. return (
  12. <Tabs
  13. screenOptions={{
  14. tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
  15. headerShown: false,
  16. tabBarButton: HapticTab,
  17. tabBarBackground: TabBarBackground,
  18. tabBarStyle: Platform.select({
  19. ios: {
  20. // Use a transparent background on iOS to show the blur effect
  21. position: 'absolute',
  22. },
  23. default: {},
  24. }),
  25. }}>
  26. <Tabs.Screen
  27. name="index"
  28. options={{
  29. title: 'Home',
  30. tabBarIcon: ({ color }) => <IconSymbol size={28} name="house.fill" color={color} />,
  31. }}
  32. />
  33. <Tabs.Screen
  34. name="explore"
  35. options={{
  36. title: 'Explore',
  37. tabBarIcon: ({ color }) => <IconSymbol size={28} name="paperplane.fill" color={color} />,
  38. }}
  39. />
  40. </Tabs>
  41. );
  42. }