-
-
Notifications
You must be signed in to change notification settings - Fork 5k
/
screens.tsx
122 lines (115 loc) · 3.32 KB
/
screens.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import type { NavigatorScreenParams } from '@react-navigation/native';
import AuthFlow from './Screens/AuthFlow';
import BottomTabs from './Screens/BottomTabs';
import DrawerView from './Screens/DrawerView';
import DynamicTabs from './Screens/DynamicTabs';
import LinkComponent from './Screens/LinkComponent';
import MasterDetail from './Screens/MasterDetail';
import MaterialTopTabsScreen from './Screens/MaterialTopTabs';
import MixedHeaderMode from './Screens/MixedHeaderMode';
import MixedStack from './Screens/MixedStack';
import ModalStack from './Screens/ModalStack';
import NativeStack from './Screens/NativeStack';
import NativeStackHeaderCustomization from './Screens/NativeStackHeaderCustomization';
import NativeStackPreventRemove from './Screens/NativeStackPreventRemove';
import SimpleStack from './Screens/SimpleStack';
import StackHeaderCustomization from './Screens/StackHeaderCustomization';
import StackPreventRemove from './Screens/StackPreventRemove';
import StackTransparent from './Screens/StackTransparent';
import TabView from './Screens/TabView';
export type RootDrawerParamList = {
Examples: undefined;
};
export type LinkComponentDemoParamList = {
Article: { author: string };
Albums: undefined;
};
export const SCREENS = {
NativeStack: {
title: 'Native Stack',
component: NativeStack,
},
SimpleStack: {
title: 'Simple Stack',
component: SimpleStack,
},
ModalStack: {
title: 'Modal Stack',
component: ModalStack,
},
MixedStack: {
title: 'Regular + Modal Stack',
component: MixedStack,
},
MixedHeaderMode: {
title: 'Float + Screen Header Stack',
component: MixedHeaderMode,
},
StackTransparent: {
title: 'Transparent Stack',
component: StackTransparent,
},
StackHeaderCustomization: {
title: 'Header Customization in Stack',
component: StackHeaderCustomization,
},
NativeStackHeaderCustomization: {
title: 'Header Customization in Native Stack',
component: NativeStackHeaderCustomization,
},
BottomTabs: {
title: 'Bottom Tabs',
component: BottomTabs,
},
MaterialTopTabs: {
title: 'Material Top Tabs',
component: MaterialTopTabsScreen,
},
DynamicTabs: {
title: 'Dynamic Tabs',
component: DynamicTabs,
},
MasterDetail: {
title: 'Master Detail',
component: MasterDetail,
},
AuthFlow: {
title: 'Auth Flow',
component: AuthFlow,
},
StackPreventRemove: {
title: 'Prevent removing screen in Stack',
component: StackPreventRemove,
},
NativeStackPreventRemove: {
title: 'Prevent removing screen in Native Stack',
component: NativeStackPreventRemove,
},
LinkComponent: {
title: '<Link />',
component: LinkComponent,
},
TabView: {
title: 'TabView',
component: TabView,
},
DrawerView: {
title: 'DrawerView',
component: DrawerView,
},
};
type ParamListTypes = {
Home: undefined;
NotFound: undefined;
LinkComponent: NavigatorScreenParams<LinkComponentDemoParamList> | undefined;
};
export type RootStackParamList = {
[P in Exclude<keyof typeof SCREENS, keyof ParamListTypes>]: undefined;
} & ParamListTypes;
// Make the default RootParamList the same as the RootStackParamList
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace ReactNavigation {
interface RootParamList extends RootStackParamList {}
}
}