Нет описания

_layout.tsx 1.4KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { Stack, useRouter } from 'expo-router';
  2. import { Pressable } from 'react-native';
  3. import { IconSymbol } from '@/components/ui/icon-symbol';
  4. import { Colors } from '@/constants/theme';
  5. import { useColorScheme } from '@/hooks/use-color-scheme';
  6. import { useTranslation } from '@/localization/i18n';
  7. export default function LogbookLayout() {
  8. const { t } = useTranslation();
  9. const router = useRouter();
  10. const colorScheme = useColorScheme();
  11. return (
  12. <Stack
  13. screenOptions={{
  14. headerBackTitleVisible: false,
  15. headerBackTitle: '',
  16. headerBackTitleStyle: { display: 'none' },
  17. headerLeft: ({ canGoBack }) =>
  18. canGoBack ? (
  19. <Pressable onPress={() => router.back()} hitSlop={10} style={{ paddingHorizontal: 8 }}>
  20. <IconSymbol size={20} name="chevron.left" color={Colors[colorScheme ?? 'light'].text} />
  21. </Pressable>
  22. ) : null,
  23. }}>
  24. <Stack.Screen name="index" options={{ title: t('logbook.title') }} />
  25. <Stack.Screen name="fields" options={{ title: t('fields.title') }} />
  26. <Stack.Screen name="fields/[id]" options={{ title: t('fields.edit') }} />
  27. <Stack.Screen name="crops" options={{ title: t('crops.title') }} />
  28. <Stack.Screen name="crops/new" options={{ title: t('crops.new') }} />
  29. <Stack.Screen name="crops/[id]" options={{ title: t('crops.edit') }} />
  30. </Stack>
  31. );
  32. }