Skip to content
This repository was archived by the owner on May 8, 2019. It is now read-only.

Commit 952e2d4

Browse files
authored
Cleanup after all merge (#16)
1 parent 454e12f commit 952e2d4

File tree

3 files changed

+26
-19
lines changed

3 files changed

+26
-19
lines changed

example/src/App.re

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
1-
let stack = Stack.render;
1+
let stack = StackExample.render;
22
let tab = TabExample.render;
33
let drawer = DrawerExample.render;
44

5-
module Switch =
6-
SwitchNavigator.Create({
7-
open SwitchNavigator;
8-
9-
type route = Config.loginRoute;
10-
let initialRoute = Login;
11-
12-
let getScreen = (route, navigation) =>
13-
switch (route) {
14-
| Login => (<Login navigation />, screenOptions())
15-
| LoggedIn => (<LoggedIn navigation />, screenOptions())
16-
};
17-
});
18-
19-
let switchNavigator = Switch.render;
5+
let switchNavigator = SwitchExample.render;
206

217
let app = drawer;

example/src/Stack.re renamed to example/src/StackExample.re

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ open BsReactNavigation;
77
open Config;
88

99
module Stack =
10-
1110
StackNavigator.Create({
1211
open StackNavigator;
1312

@@ -21,7 +20,6 @@ module Stack =
2120
*/
2221
let initialRoute = Home;
2322

24-
2523
/**
2624
* Returns a screen for a given route and its options.
2725
*
@@ -37,7 +35,7 @@ module Stack =
3735
<Screen navigation text={"Browsing profile of: " ++ userId} />,
3836
screenOptions(~title="Hello " ++ userId, ()),
3937
)
40-
| TabExample => (<TabExample navigation/>, screenOptions())
38+
| TabExample => (<TabExample navigation />, screenOptions())
4139
};
4240
});
4341

example/src/SwitchExample.re

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
open BsReactNavigation;
2+
3+
/**
4+
* Route and Navigation types are kept in a separate module to
5+
* handle circular references between modules
6+
*/
7+
open Config;
8+
9+
module Switch =
10+
SwitchNavigator.Create({
11+
open SwitchNavigator;
12+
13+
type route = Config.loginRoute;
14+
let initialRoute = Login;
15+
16+
let getScreen = (route, navigation) =>
17+
switch (route) {
18+
| Login => (<Login navigation />, screenOptions())
19+
| LoggedIn => (<LoggedIn navigation />, screenOptions())
20+
};
21+
});
22+
23+
let render = Switch.render;

0 commit comments

Comments
 (0)