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.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { Tabs } from 'expo-router';
  2. import React from 'react';
  3. import { Platform } from 'react-native';
  4. import Icon from 'react-native-vector-icons/MaterialIcons';
  5. import { HapticTab } from '@/components/HapticTab';
  6. import { IconSymbol } from '@/components/ui/IconSymbol';
  7. import TabBarBackground from '@/components/ui/TabBarBackground';
  8. import { Colors } from '@/constants/Colors';
  9. import { useColorScheme } from '@/hooks/useColorScheme';
  10. export default function ScreenLayout() {
  11. const colorScheme = useColorScheme();
  12. return (
  13. <Tabs
  14. screenOptions={{
  15. tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
  16. headerShown: false,
  17. tabBarButton: HapticTab,
  18. tabBarBackground: TabBarBackground,
  19. tabBarIconStyle: {
  20. marginTop: 10,
  21. },
  22. tabBarStyle: Platform.select({
  23. ios: {
  24. position: 'absolute',
  25. height: 70,
  26. },
  27. default: {
  28. backgroundColor: '#396868',
  29. height: 70,
  30. borderTopWidth: 0,
  31. paddingVertical: 10
  32. },
  33. }),
  34. }}
  35. >
  36. <Tabs.Screen
  37. name="index"
  38. options={{
  39. title: 'Home',
  40. tabBarIcon: ({ color }) => <Icon name="home" size={25} color={color} />,
  41. }}
  42. />
  43. <Tabs.Screen
  44. name="notify"
  45. options={{
  46. title: 'Notify',
  47. tabBarIcon: ({ color }) => <Icon name="edit-document" size={25} color={color} />,
  48. }}
  49. />
  50. <Tabs.Screen
  51. name="profile"
  52. options={{
  53. title: 'Profile',
  54. tabBarIcon: ({ color }) => <Icon name="person" size={25} color={color} />,
  55. }}
  56. />
  57. </Tabs>
  58. );
  59. }