NoticeStackNavigator.tsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import {
  2. NavigationContainer,
  3. DefaultTheme,
  4. DarkTheme,
  5. } from '@react-navigation/native';
  6. import {
  7. createStackNavigator,
  8. CardStyleInterpolators,
  9. } from '@react-navigation/stack';
  10. import * as React from 'react';
  11. import { ColorSchemeName } from 'react-native';
  12. import useModel from 'flooks';
  13. import { useTranslation } from 'react-i18next';
  14. import { NoticeStackParamList } from '../types';
  15. import NoticeScreen from '../notice/NoticeScreen';
  16. const NoticeStack = createStackNavigator<NoticeStackParamList>();
  17. export default function Navigation({
  18. colorScheme,
  19. }: {
  20. colorScheme: ColorSchemeName;
  21. }) {
  22. const { t } = useTranslation();
  23. return (
  24. <NoticeStack.Navigator
  25. initialRouteName="Notice"
  26. screenOptions={{
  27. cardOverlayEnabled: true,
  28. cardStyle: { backgroundColor: '#f2f2f2', flex: 1 },
  29. contentStyle: { backgroundColor: '#f2f2f2', flex: 1 },
  30. gestureEnabled: true,
  31. stackPresentation: 'push',
  32. cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS,
  33. headerStyle: {
  34. backgroundColor: '#FFC21C',
  35. },
  36. headerTintColor: '#fff',
  37. headerTitleStyle: {
  38. fontWeight: 'bold',
  39. },
  40. headerTitleAlign: 'center',
  41. headerBackTitleVisible: false,
  42. }}
  43. >
  44. <NoticeStack.Screen
  45. name="Notice"
  46. component={NoticeScreen}
  47. options={{ title: t('qi-shou-shen-he') }}
  48. />
  49. </NoticeStack.Navigator>
  50. );
  51. }