@@ -59,14 +59,13 @@ module type TabConfig = {
59
59
let containerName : string ;
60
60
let tabBarOptions : tabBarOptions ;
61
61
let getTab :
62
- (tabs , navigation ) => (Js . Dict . key , unit => ReasonReact . reactElement , screenOptions );
62
+ (tabs , navigation ) =>
63
+ (Js . Dict . key , unit => ReasonReact . reactElement , screenOptions );
63
64
};
64
65
65
66
module Create = (Config : TabConfig ) => {
66
-
67
67
[@ bs . deriving abstract]
68
68
type navigatorConfig = {initialRouteName: string };
69
-
70
69
71
70
[@ bs . deriving abstract]
72
71
type routeConfig = {
@@ -75,22 +74,21 @@ module Create = (Config: TabConfig) => {
75
74
};
76
75
77
76
module NavigationProp = {
77
+ [@ bs . send ] external navigate : string => unit = "navigate" ;
78
78
79
- [@ bs . send ] external navigate : (string ) => unit = "navigate" ;
80
-
81
-
82
- [@ bs . send ] external goBack : (unit ) => unit = "goBack" ;
79
+ [@ bs . send ] external goBack : unit => unit = "goBack" ;
83
80
};
84
81
85
82
let makeNavigationProp = () => {
86
- navigate: routeName => NavigationProp . navigate(routeName),
87
- goBack: () => NavigationProp . goBack() ,
88
- };
83
+ navigate: routeName => NavigationProp . navigate(routeName),
84
+ goBack: () => NavigationProp . goBack() ,
85
+ };
89
86
90
87
let tabs =
91
88
Config . order
92
89
|> List . map(tab => {
93
- let (tabname , screen , screenOptionsConfig ) = Config . getTab(tab, makeNavigationProp() );
90
+ let (tabname , screen , screenOptionsConfig ) =
91
+ Config . getTab(tab, makeNavigationProp() );
94
92
(
95
93
tabname,
96
94
routeConfig(~screen, ~navigationOptions= screenOptionsConfig),
@@ -104,9 +102,8 @@ module Create = (Config: TabConfig) => {
104
102
"tabBarOptions" : Config . tabBarOptions,
105
103
};
106
104
107
- let navigator = ReactNavigation . Tab . createBottomTabNavigator(tabs, tabBarOptions)
108
-
109
- let make = ReactNavigation . Native . createAppContainer(navigator)
110
-
111
- };
105
+ let navigator =
106
+ ReactNavigation . Tab . createBottomTabNavigator(tabs, tabBarOptions);
112
107
108
+ let make = ReactNavigation . Native . createAppContainer(navigator);
109
+ };
0 commit comments