NoticeStackNavigator.tsx 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 ChatScreen from '../notice/ChatScreen';
  16. import EmailDetailScreen from '../notice/EmailDetailScreen';
  17. const NoticeStack = createStackNavigator<NoticeStackParamList>();
  18. export default function Navigation({
  19. colorScheme,
  20. }: {
  21. colorScheme: ColorSchemeName;
  22. }) {
  23. const { t } = useTranslation();
  24. return (
  25. <NoticeStack.Navigator
  26. initialRouteName="EmailDetail"
  27. screenOptions={{
  28. cardOverlayEnabled: true,
  29. cardStyle: { backgroundColor: '#f2f2f2', flex: 1 },
  30. contentStyle: { backgroundColor: '#f2f2f2', flex: 1 },
  31. gestureEnabled: true,
  32. stackPresentation: 'push',
  33. cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS,
  34. headerStyle: {
  35. backgroundColor: '#FFC21C',
  36. elevation: 0,
  37. shadowOffset: {
  38. width: 0,
  39. height: 0,
  40. },
  41. shadowOpacity: 0,
  42. shadowRadius: 0,
  43. },
  44. headerTintColor: '#fff',
  45. headerTitleStyle: {
  46. fontWeight: 'bold',
  47. },
  48. headerTitleAlign: 'center',
  49. headerBackTitleVisible: false,
  50. }}
  51. >
  52. <NoticeStack.Screen
  53. name="Chat"
  54. component={ChatScreen}
  55. options={{ title: t('liao-tian') }}
  56. />
  57. <NoticeStack.Screen
  58. name="EmailDetail"
  59. component={EmailDetailScreen}
  60. options={{ title: t('xi-tong-ti-xing') }}
  61. initialParams={{ emailId: 2160 }}
  62. />
  63. </NoticeStack.Navigator>
  64. );
  65. }