Няма описание

_layout.tsx 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import { Tabs } from 'expo-router';
  2. import React from 'react';
  3. import { HapticTab } from '@/components/haptic-tab';
  4. import { IconSymbol } from '@/components/ui/icon-symbol';
  5. import { Colors } from '@/constants/theme';
  6. import { useColorScheme } from '@/hooks/use-color-scheme';
  7. import { useTranslation } from '@/localization/i18n';
  8. export default function TabLayout() {
  9. const colorScheme = useColorScheme();
  10. const { t } = useTranslation();
  11. return (
  12. <Tabs
  13. screenOptions={{
  14. tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
  15. headerShown: false,
  16. tabBarButton: HapticTab,
  17. }}>
  18. <Tabs.Screen
  19. name="index"
  20. options={{
  21. title: t('tabs.home'),
  22. tabBarIcon: ({ color }) => <IconSymbol size={28} name="house.fill" color={color} />,
  23. }}
  24. />
  25. <Tabs.Screen
  26. name="logbook"
  27. options={{
  28. title: t('tabs.logbook'),
  29. headerShown: false,
  30. tabBarIcon: ({ color }) => <IconSymbol size={28} name="book.fill" color={color} />,
  31. }}
  32. />
  33. <Tabs.Screen
  34. name="explore"
  35. options={{
  36. href: null,
  37. }}
  38. />
  39. <Tabs.Screen
  40. name="blog"
  41. options={{
  42. title: t('tabs.blog'),
  43. tabBarIcon: ({ color }) => <IconSymbol size={28} name="doc.text.image" color={color} />,
  44. }}
  45. />
  46. <Tabs.Screen
  47. name="onnx"
  48. options={{
  49. title: t('tabs.onnx'),
  50. tabBarIcon: ({ color }) => <IconSymbol size={28} name="bolt.circle.fill" color={color} />,
  51. }}
  52. />
  53. <Tabs.Screen
  54. name="setup"
  55. options={{
  56. title: t('tabs.setup'),
  57. tabBarIcon: ({ color }) => <IconSymbol size={28} name="leaf.fill" color={color} />,
  58. }}
  59. />
  60. <Tabs.Screen name="observations" options={{ href: null }} />
  61. <Tabs.Screen name="harvests" options={{ href: null }} />
  62. <Tabs.Screen name="sales" options={{ href: null }} />
  63. <Tabs.Screen name="costs" options={{ href: null }} />
  64. <Tabs.Screen name="tasks" options={{ href: null }} />
  65. <Tabs.Screen
  66. name="task-history"
  67. options={{
  68. href: null,
  69. headerShown: true,
  70. title: t('tasks.historyTitle'),
  71. }}
  72. />
  73. </Tabs>
  74. );
  75. }